diff options
author | Guido van Rossum <guido@python.org> | 2001-09-21 19:22:34 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-09-21 19:22:34 (GMT) |
commit | dbb718fa8775731666bb9cbc73662fadee41ea8f (patch) | |
tree | 9081dce67bff0bca69fe2eed9e6e832126edd77e /Lib/zipfile.py | |
parent | 11310bf867ae1c26d2ad9dc696bf2331709b9843 (diff) | |
download | cpython-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.py | 5 |
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): |