summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2016-05-09 03:58:39 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2016-05-09 03:58:39 (GMT)
commit36b38cccb12248c106575753a8f2807bfd88c2fa (patch)
tree0ed6a125096c2d19ddce88c1f4e0423cf38afc3e /src/engine/SCons
parentc591da06c1a18873d09323d6700d1469120ad27d (diff)
downloadSCons-36b38cccb12248c106575753a8f2807bfd88c2fa.zip
SCons-36b38cccb12248c106575753a8f2807bfd88c2fa.tar.gz
SCons-36b38cccb12248c106575753a8f2807bfd88c2fa.tar.bz2
py2/3 compatibility changes.
Diffstat (limited to 'src/engine/SCons')
-rw-r--r--src/engine/SCons/Util.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 5b11f83..a5a92fa 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -32,13 +32,27 @@ import copy
import re
import types
-from UserDict import UserDict
-from UserList import UserList
-from UserString import UserString
+try:
+ from UserDict import UserDict
+except ImportError as e:
+ from collections import UserDict
+
+try:
+ from UserList import UserList
+except ImportError as e:
+ from collections import UserList
+
+try:
+ from UserString import UserString
+except ImportError as e:
+ from collections import UserString
# Don't "from types import ..." these because we need to get at the
# types module later to look for UnicodeType.
-InstanceType = types.InstanceType
+
+# Below not used?
+# InstanceType = types.InstanceType
+
MethodType = types.MethodType
FunctionType = types.FunctionType
try: unicode