summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-21 19:22:34 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-21 19:22:34 (GMT)
commitdbb718fa8775731666bb9cbc73662fadee41ea8f (patch)
tree9081dce67bff0bca69fe2eed9e6e832126edd77e /Lib/zipfile.py
parent11310bf867ae1c26d2ad9dc696bf2331709b9843 (diff)
downloadcpython-dbb718fa8775731666bb9cbc73662fadee41ea8f.zip
cpython-dbb718fa8775731666bb9cbc73662fadee41ea8f.tar.gz
cpython-dbb718fa8775731666bb9cbc73662fadee41ea8f.tar.bz2
Make these modules work when Python is compiled without Unicode support.
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 816d887..a06731e 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -66,7 +66,10 @@ _FH_FILENAME_LENGTH = 10
_FH_EXTRA_FIELD_LENGTH = 11
# Used to compare file passed to ZipFile
-_STRING_TYPES = (type('s'), type(u's'))
+import types
+_STRING_TYPES = (types.StringType,)
+if hasattr(types, "UnicodeType"):
+ _STRING_TYPES = _STRING_TYPES + (types.UnicodeType,)
def is_zipfile(filename):