File tree 1 file changed +2
-17
lines changed
1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -66,23 +66,8 @@ def Unzip(APP_PATH, EXT_PATH):
66
66
files = []
67
67
with zipfile .ZipFile (APP_PATH , "r" ) as z :
68
68
for fileinfo in z .infolist ():
69
- dat = z .open (fileinfo .filename , "r" )
70
- filename = fileinfo .filename
71
- if not isinstance (filename , unicode ):
72
- filename = unicode (fileinfo .filename ,
73
- encoding = "utf-8" , errors = "replace" )
74
- files .append (filename )
75
- outfile = os .path .join (EXT_PATH , filename )
76
- if not os .path .exists (os .path .dirname (outfile )):
77
- try :
78
- os .makedirs (os .path .dirname (outfile ))
79
- except OSError as exc : # Guard against race condition
80
- if exc .errno != errno .EEXIST :
81
- print "\n [WARN] OS Error: Race Condition"
82
- if not outfile .endswith ("/" ):
83
- with io .open (outfile , mode = 'wb' ) as f :
84
- f .write (dat .read ())
85
- dat .close ()
69
+ files .append (fileinfo .filename )
70
+ z .extract (fileinfo , EXT_PATH )
86
71
return files
87
72
except :
88
73
PrintException ("[ERROR] Unzipping Error" )
You can’t perform that action at this time.
0 commit comments