summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2015-11-19 19:35:22 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2015-11-19 19:35:22 (GMT)
commit69d99ab6717f017e85da21b11e6898de18023616 (patch)
tree6c294fd75fc3f079b429707ae5909ea63626ec0a
parent2fea16ec321622be084cb511b001e57f7c1bf6d3 (diff)
downloadSCons-69d99ab6717f017e85da21b11e6898de18023616.zip
SCons-69d99ab6717f017e85da21b11e6898de18023616.tar.gz
SCons-69d99ab6717f017e85da21b11e6898de18023616.tar.bz2
update logic for sys.intern in compat module. Don't need to support pre 2.7 anymore
-rw-r--r--src/engine/SCons/compat/__init__.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py
index 1ef2b25..3d5c835 100644
--- a/src/engine/SCons/compat/__init__.py
+++ b/src/engine/SCons/compat/__init__.py
@@ -126,19 +126,17 @@ rename_module('queue', 'Queue')
rename_module('winreg', '_winreg')
+# Python 3 moved builtin intern() to sys package
+# To make porting easier, make intern always live
+# in sys package (for python 2.7.x)
try:
sys.intern
except AttributeError:
- # Pre-2.6 Python has no sys.intern() function.
+ # We must be using python 2.7.x so monkey patch
+ # intern into the sys package
import builtins
- try:
- sys.intern = builtins.intern
- except AttributeError:
- # Pre-2.x Python has no builtin intern() function.
- def intern(x):
- return x
- sys.intern = intern
- del intern
+ sys.intern = builtins.intern
+
# Preparing for 3.x. UserDict, UserList, UserString are in