New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for approval #1452

Closed
wants to merge 4 commits into
base: master
from
View
@@ -1740,7 +1740,9 @@ def magic_run(self, parameter_s ='', runner=None,
main_mod = self.shell.new_main_mod()
prog_ns = main_mod.__dict__
prog_ns['__name__'] = name
prog_ns['execfile'] = 'py3compat.execfile'

This comment has been minimized.

@takluyver

takluyver Feb 29, 2012

Member

This needs to be the function itself, not the name (i.e. lose the quotation marks)

@takluyver

takluyver Feb 29, 2012

Member

This needs to be the function itself, not the name (i.e. lose the quotation marks)

This comment has been minimized.

@dchetwynd

dchetwynd Feb 29, 2012

Thanks Thomas,

I'll make the change tonight and submit another pull request.

Daley

On Tue, Feb 28, 2012, at 04:01 PM, Thomas wrote:

@@ -1740,7 +1740,9 @@ def magic_run(self, parameter_s ='', runner=None,
main_mod = self.shell.new_main_mod()
prog_ns = main_mod.dict

prog_ns['name'] = name

  •    prog_ns['execfile'] = 'py3compat.execfile'
    

This needs to be the function itself, not the name (i.e. lose the
quotation marks)


Reply to this email directly or view it on GitHub:
https://github.com/ipython/ipython/pull/1452/files#r499306

http://www.fastmail.fm - Does exactly what it says on the tin

@dchetwynd

dchetwynd Feb 29, 2012

Thanks Thomas,

I'll make the change tonight and submit another pull request.

Daley

On Tue, Feb 28, 2012, at 04:01 PM, Thomas wrote:

@@ -1740,7 +1740,9 @@ def magic_run(self, parameter_s ='', runner=None,
main_mod = self.shell.new_main_mod()
prog_ns = main_mod.dict

prog_ns['name'] = name

  •    prog_ns['execfile'] = 'py3compat.execfile'
    

This needs to be the function itself, not the name (i.e. lose the
quotation marks)


Reply to this email directly or view it on GitHub:
https://github.com/ipython/ipython/pull/1452/files#r499306

http://www.fastmail.fm - Does exactly what it says on the tin

This comment has been minimized.

@takluyver

takluyver Feb 29, 2012

Member

You don't need to submit a new PR - if you commit the change on the same branch and push it, the pull request will automatically get updated ;-)

@takluyver

takluyver Feb 29, 2012

Member

You don't need to submit a new PR - if you commit the change on the same branch and push it, the pull request will automatically get updated ;-)

# Since '%run foo' emulates 'python foo.py' at the cmd line, we must
# set the __file__ global in the script's namespace
prog_ns['__file__'] = filename
@@ -1871,6 +1873,9 @@ def magic_run(self, parameter_s ='', runner=None,
# exit.
self.shell.user_ns['__builtins__'] = builtin_mod
if prog_ns.has_key('execfile'):

This comment has been minimized.

@takluyver

takluyver Mar 1, 2012

Member

Oh, and it's generally good practice now to use 'execfile' in prog_ns rather than calling has_key.

@takluyver

takluyver Mar 1, 2012

Member

Oh, and it's generally good practice now to use 'execfile' in prog_ns rather than calling has_key.

del prog_ns['execfile']
# Ensure key global structures are restored
sys.argv = save_argv
if restore_main:
ProTip! Use n and p to navigate between commits in a pull request.