Issue #23075: Whether __builtins__ is a module or a dict is undefined in
CPython. Use the reliably well defined `import __builtin__` instead. Patch by Alex Gaynor.
This commit is contained in:
parent
a8e8f7ee1c
commit
9f696c9809
|
@ -24,6 +24,7 @@ __all__ = (
|
|||
__version__ = '1.0'
|
||||
|
||||
|
||||
import __builtin__
|
||||
import inspect
|
||||
import pprint
|
||||
import sys
|
||||
|
@ -32,7 +33,7 @@ from types import ModuleType
|
|||
from functools import wraps, partial
|
||||
|
||||
|
||||
_builtins = {name for name in __builtins__ if not name.startswith('_')}
|
||||
_builtins = {name for name in dir(__builtin__) if not name.startswith('_')}
|
||||
|
||||
BaseExceptions = (BaseException,)
|
||||
if 'java' in sys.platform:
|
||||
|
|
Loading…
Reference in New Issue