diff options
author | Stefan Zimmermann <zimmermann.code@gmail.com> | 2014-03-31 15:13:02 +0000 |
---|---|---|
committer | Stefan Zimmermann <zimmermann.code@gmail.com> | 2014-03-31 15:13:02 +0000 |
commit | 15ad84e7cd33f33d287c63d6e00a221d859cce3b (patch) | |
tree | 4464eb544fe0cc698ea4d1c5789e19770b83cd6f /bench/is_types.py | |
parent | 9d3a9c2cc0187294500ea8018a7ffcc1c7b67037 (diff) | |
download | scons-15ad84e7cd33f33d287c63d6e00a221d859cce3b.tar.gz |
Made former 2to3 changes Python 2.7 compatible (or removed unneeded changes).
Diffstat (limited to 'bench/is_types.py')
-rw-r--r-- | bench/is_types.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bench/is_types.py b/bench/is_types.py index b6da0d25..69c029fc 100644 --- a/bench/is_types.py +++ b/bench/is_types.py @@ -17,11 +17,11 @@ InstanceType = types.InstanceType DictType = dict ListType = list StringType = str -try: str +try: unicode except NameError: UnicodeType = None else: - UnicodeType = str + UnicodeType = unicode # The original implementations, pretty straightforward checks for the @@ -36,7 +36,7 @@ def original_is_List(e): if UnicodeType is not None: def original_is_String(e): - return isinstance(e, (str,UserString)) + return isinstance(e, (str,unicode,UserString)) else: def original_is_String(e): return isinstance(e, (str,UserString)) @@ -58,7 +58,7 @@ def checkInstanceType_is_List(e): if UnicodeType is not None: def checkInstanceType_is_String(e): return isinstance(e, str) \ - or isinstance(e, str) \ + or isinstance(e, unicode) \ or (isinstance(e, types.InstanceType) and isinstance(e, UserString)) else: def checkInstanceType_is_String(e): @@ -84,7 +84,7 @@ if UnicodeType is not None: def cache_type_e_is_String(e): t = type(e) return t is str \ - or t is str \ + or t is unicode \ or (t is types.InstanceType and isinstance(e, UserString)) else: def cache_type_e_is_String(e): @@ -136,7 +136,7 @@ if UnicodeType is not None: t = type(obj) if t is types.InstanceType: t = instanceTypeMap.get(obj.__class__, t) - elif t is str: + elif t is unicode: t = str return t else: |