From: Guido van Rossum Date: Sun, 19 Aug 2001 05:29:25 +0000 (+0000) Subject: Avoid total dependency on the new module. This addresses the problem X-Git-Tag: v2.2a3~434 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8cb00e2387efe2304e9eba6f2c3be6cc977f680e;p=thirdparty%2FPython%2Fcpython.git Avoid total dependency on the new module. This addresses the problem reported by Greg Ball on python-dev. --- diff --git a/Lib/__future__.py b/Lib/__future__.py index 5a6483832e8c..ebb44a71f6d6 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):