From 1e619bdb0bee5db7a939dbd35148a5247e77f217 2011-07-18 19:28:56 From: MinRK Date: 2011-07-18 19:28:56 Subject: [PATCH] use list comprehension instead of map, for py3k compat in %run, map(expanduser, args) returns a generator, which can't be concatenated onto a list --- diff --git a/IPython/core/magic.py b/IPython/core/magic.py index afd3f4c..34b49e4 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -1593,7 +1593,7 @@ Currently the magic system has the following functions:\n""" save_argv = sys.argv # save it for later restoring # simulate shell expansion on arguments, at least tilde expansion - args = map(os.path.expanduser, arg_lst[1:]) + args = [ os.path.expanduser(a) for a in arg_lst[1:] ] sys.argv = [filename]+ args # put in the proper filename