Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8cb00e2

Browse files
committed
Avoid total dependency on the new module. This addresses the problem
reported by Greg Ball on python-dev.
1 parent b446fc7 commit 8cb00e2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Lib/__future__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@
5555

5656
__all__ = ["all_feature_names"] + all_feature_names
5757

58-
import new as _new # for CO_xxx symbols
58+
try:
59+
import new as _new # for CO_xxx symbols
60+
except ImportError: # May happen during build
61+
class _new:
62+
CO_NESTED = 0x0010
63+
CO_GENERATOR_ALLOWED = 0x1000
64+
CO_FUTURE_DIVISION = 0x2000
5965

6066
class _Feature:
6167
def __init__(self, optionalRelease, mandatoryRelease, compiler_flag):

0 commit comments

Comments
 (0)