mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Patch #1550800: make exec a function.
This commit is contained in:
parent
4e472e05bd
commit
7cae87ca7b
105 changed files with 1246 additions and 1583 deletions
|
@ -58,7 +58,7 @@ class FileDelegate(FileBase):
|
|||
self.name = name
|
||||
|
||||
for m in FileBase.ok_file_methods + ('close',):
|
||||
exec TEMPLATE % (m, m)
|
||||
exec(TEMPLATE % (m, m))
|
||||
|
||||
|
||||
class RHooks(ihooks.Hooks):
|
||||
|
@ -310,7 +310,7 @@ class RExec(ihooks._Verbose):
|
|||
|
||||
"""
|
||||
m = self.add_module('__main__')
|
||||
exec code in m.__dict__
|
||||
exec(code, m.__dict__)
|
||||
|
||||
def r_eval(self, code):
|
||||
"""Evaluate code within a restricted environment.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue