summaryrefslogtreecommitdiffstats
path: root/bench
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-04-26 18:49:06 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-04-26 18:49:06 (GMT)
commit28b036c0f803c2a156de7e155daa0f8635e95d89 (patch)
treef4c4ceb24a3fe3001dc394e833731ebdfbcca208 /bench
parent186b632fd20283e821b6a65c72772635017945fb (diff)
downloadSCons-28b036c0f803c2a156de7e155daa0f8635e95d89.zip
SCons-28b036c0f803c2a156de7e155daa0f8635e95d89.tar.gz
SCons-28b036c0f803c2a156de7e155daa0f8635e95d89.tar.bz2
http://scons.tigris.org/issues/show_bug.cgi?id=2345
Apply all the remaining changes from the fixers.
Diffstat (limited to 'bench')
-rw-r--r--bench/is_types.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/bench/is_types.py b/bench/is_types.py
index 0353dc8..b47c381 100644
--- a/bench/is_types.py
+++ b/bench/is_types.py
@@ -5,9 +5,13 @@
# src/engine/SCons/Util.py.
import types
-from UserDict import UserDict
-from UserList import UserList
-from UserString import UserString
+try:
+ from collections import UserDict, UserList, UserString
+except ImportError:
+ # No 'collections' module or no UserFoo in collections
+ exec('from UserDict import UserDict')
+ exec('from UserList import UserList')
+ exec('from UserString import UserString')
InstanceType = types.InstanceType
DictType = dict
@@ -25,19 +29,17 @@ else:
# User* type.
def original_is_Dict(e):
- return isinstance(e, dict) or isinstance(e, UserDict)
+ return isinstance(e, (dict,UserDict))
def original_is_List(e):
- return isinstance(e, list) or isinstance(e, UserList)
+ return isinstance(e, (list,UserList))
if UnicodeType is not None:
def original_is_String(e):
- return isinstance(e, str) \
- or isinstance(e, unicode) \
- or isinstance(e, UserString)
+ return isinstance(e, (str,unicode,UserString))
else:
def original_is_String(e):
- return isinstance(e, str) or isinstance(e, UserString)
+ return isinstance(e, (str,UserString))