Kaydet (Commit) a62b1003 authored tarafından Guido van Rossum's avatar Guido van Rossum

noted obsolescence; exec() -> exec

üst 894a7bb9
# Print tracebacks, with a dump of local variables. # Print tracebacks, with a dump of local variables.
# Also an interactive stack trace browser. # Also an interactive stack trace browser.
# Note -- this module is obsolete -- use pdb.pm() instead.
import sys import sys
import os import os
...@@ -71,7 +72,7 @@ def browserexec(tb, cmd): ...@@ -71,7 +72,7 @@ def browserexec(tb, cmd):
locals = tb.tb_frame.f_locals locals = tb.tb_frame.f_locals
globals = tb.tb_frame.f_globals globals = tb.tb_frame.f_globals
try: try:
exec(cmd+'\n', globals, locals) exec cmd+'\n' in globals, locals
except: except:
print '*** Exception:', print '*** Exception:',
if type(sys.exc_type) == type(''): if type(sys.exc_type) == type(''):
......
# Print tracebacks, with a dump of local variables. # Print tracebacks, with a dump of local variables.
# Also an interactive stack trace browser. # Also an interactive stack trace browser.
# Note -- this module is obsolete -- use pdb.pm() instead.
import sys import sys
import os import os
...@@ -71,7 +72,7 @@ def browserexec(tb, cmd): ...@@ -71,7 +72,7 @@ def browserexec(tb, cmd):
locals = tb.tb_frame.f_locals locals = tb.tb_frame.f_locals
globals = tb.tb_frame.f_globals globals = tb.tb_frame.f_globals
try: try:
exec(cmd+'\n', globals, locals) exec cmd+'\n' in globals, locals
except: except:
print '*** Exception:', print '*** Exception:',
if type(sys.exc_type) == type(''): if type(sys.exc_type) == type(''):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment