mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Actually initialize __main__.__loader__ with loader instances, not the corresponding type objects
This commit is contained in:
parent
8dbe5b5568
commit
3f94cbf9eb
2 changed files with 8 additions and 3 deletions
|
@ -37,7 +37,8 @@ f()
|
|||
assertEqual(result, ['Top level assignment', 'Lower level reference'])
|
||||
# Check population of magic variables
|
||||
assertEqual(__name__, '__main__')
|
||||
_loader = __loader__ if isinstance(__loader__, type) else type(__loader__)
|
||||
from importlib.machinery import BuiltinImporter
|
||||
_loader = __loader__ if __loader__ is BuiltinImporter else type(__loader__)
|
||||
print('__loader__==%a' % _loader)
|
||||
print('__file__==%a' % __file__)
|
||||
assertEqual(__cached__, None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue