http://scons.tigris.org/issues/show_bug.cgi?id=2329
[scons.git] / src / engine / SCons / compat / _scons_UserString.py
index 785a260a1308800831cf106f049336e449753d45..dfc2b3037ab7dbe8d14142f791806c1dac28039c 100644 (file)
@@ -33,17 +33,13 @@ In particular, it does not necessarily contain all of the methods found
 in later versions.
 """
 
-import types
-
-StringType = types.StringType
-
-if hasattr(types, 'UnicodeType'):
-    UnicodeType = types.UnicodeType
+try: unicode
+except NameError:
     def is_String(obj):
-        return type(obj) in (StringType, UnicodeType)
+        return type(obj) is str
 else:
     def is_String(obj):
-        return type(obj) is StringType
+        return type(obj) in (str, unicode)
 
 class UserString:
     def __init__(self, seq):