
Note: if those are handled, you can't use --safe because this check is using Python 3.6+ builtin AST. Fixes #49
34 lines
600 B
Python
34 lines
600 B
Python
#!/usr/bin/env python2
|
|
|
|
import sys
|
|
|
|
print >> sys.stderr , "Warning:" ,
|
|
print >> sys.stderr , "this is a blast from the past."
|
|
print >> sys.stderr , "Look, a repr:", `sys`
|
|
|
|
|
|
def function((_globals, _locals)):
|
|
exec "print 'hi from exec!'" in _globals, _locals
|
|
|
|
|
|
function((globals(), locals()))
|
|
|
|
|
|
# output
|
|
|
|
|
|
#!/usr/bin/env python2
|
|
|
|
import sys
|
|
|
|
print >>sys.stderr, "Warning:",
|
|
print >>sys.stderr, "this is a blast from the past."
|
|
print >>sys.stderr, "Look, a repr:", ` sys `
|
|
|
|
|
|
def function((_globals, _locals)):
|
|
exec "print 'hi from exec!'" in _globals, _locals
|
|
|
|
|
|
function((globals(), locals()))
|