summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-08-19 05:29:25 (GMT)
committerGuido van Rossum <guido@python.org>2001-08-19 05:29:25 (GMT)
commit8cb00e2387efe2304e9eba6f2c3be6cc977f680e (patch)
tree0f2881ddefe351081e6541b41495e585a0b6f8e3
parentb446fc7f2749c2335fc301d60e8f011d447875d3 (diff)
downloadcpython-8cb00e2387efe2304e9eba6f2c3be6cc977f680e.zip
cpython-8cb00e2387efe2304e9eba6f2c3be6cc977f680e.tar.gz
cpython-8cb00e2387efe2304e9eba6f2c3be6cc977f680e.tar.bz2
Avoid total dependency on the new module. This addresses the problem
reported by Greg Ball on python-dev.
-rw-r--r--Lib/__future__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/__future__.py b/Lib/__future__.py
index 5a64838..ebb44a7 100644
--- a/Lib/__future__.py
+++ b/Lib/__future__.py
@@ -55,7 +55,13 @@ all_feature_names = [
__all__ = ["all_feature_names"] + all_feature_names
-import new as _new # for CO_xxx symbols
+try:
+ import new as _new # for CO_xxx symbols
+except ImportError: # May happen during build
+ class _new:
+ CO_NESTED = 0x0010
+ CO_GENERATOR_ALLOWED = 0x1000
+ CO_FUTURE_DIVISION = 0x2000
class _Feature:
def __init__(self, optionalRelease, mandatoryRelease, compiler_flag):