mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2026-03-20 04:58:56 +00:00
Add back Python2 support (ADEPT)
This commit is contained in:
@@ -209,6 +209,7 @@ def _EndRecData(fpin):
|
||||
fpin.seek(-sizeEndCentDir, 2)
|
||||
except IOError:
|
||||
return None
|
||||
|
||||
data = fpin.read()
|
||||
if data[0:4] == stringEndArchive and data[-2:] == "\000\000":
|
||||
# the signature is correct and there's no comment, unpack structure
|
||||
@@ -662,7 +663,8 @@ class ZipFile:
|
||||
self.comment = b''
|
||||
|
||||
# Check if we were passed a file-like object
|
||||
if isinstance(file, str):
|
||||
# "str" is python3, "unicode" is python2
|
||||
if isinstance(file, str) or isinstance(file, unicode):
|
||||
self._filePassed = 0
|
||||
self.filename = file
|
||||
modeDict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'}
|
||||
|
||||
Reference in New Issue
Block a user