Permalink
Browse files

simulate shell expansion on %run arguments, at least tilde expansion

  • Loading branch information...
1 parent ec698f9 commit 2ed886f844e4dbd20ed2f1012caccc397f262daf @hmeine committed Jul 18, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 IPython/core/magic.py
View
@@ -1595,7 +1595,11 @@ def magic_run(self, parameter_s ='',runner=None,
# Make sure that the running script gets a proper sys.argv as if it
# were run from a system shell.
save_argv = sys.argv # save it for later restoring
- sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
+
+ # simulate shell expansion on arguments, at least tilde expansion
+ args = map(os.path.expanduser, arg_lst[1:])
+
+ sys.argv = [filename]+ args # put in the proper filename
if opts.has_key('i'):
# Run in user's interactive namespace

0 comments on commit 2ed886f

Please sign in to comment.