mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +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
|
|
@ -199,7 +199,7 @@ class TestRetrievingSourceCode(GetSourceBase):
|
|||
m = sys.modules[name] = module(name)
|
||||
m.__file__ = "<string>" # hopefully not a real filename...
|
||||
m.__loader__ = "dummy" # pretend the filename is understood by a loader
|
||||
exec "def x(): pass" in m.__dict__
|
||||
exec("def x(): pass", m.__dict__)
|
||||
self.assertEqual(inspect.getsourcefile(m.x.func_code), '<string>')
|
||||
del sys.modules[name]
|
||||
inspect.getmodule(compile('a=10','','single'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue