Make these modules work when Python is compiled without Unicode support.

This commit is contained in:
Guido van Rossum 2001-09-21 19:22:34 +00:00
parent 11310bf867
commit dbb718fa87
3 changed files with 18 additions and 5 deletions

View file

@ -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):