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:
Serhiy Storchaka 2015-03-21 22:04:42 +02:00
parent a8e8f7ee1c
commit 9f696c9809
1 changed files with 2 additions and 1 deletions

View File

@ -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: