Skip to content

Commit

Permalink
Changed to ignore warnings when unzipping
Browse files Browse the repository at this point in the history
This is apparently important for some github zips
  • Loading branch information
inclement committed Jun 18, 2016
1 parent 9e9399b commit f506459
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pythonforandroid/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,13 @@ def unpack(self, arch):
self.ctx.packages_path, self.name, filename)
if isfile(extraction_filename):
if extraction_filename.endswith('.zip'):
sh.unzip(extraction_filename)
try:
sh.unzip(extraction_filename)
except sh.ErrorReturnCode_1:
pass # return code 1 means unzipping had
# warnings but did complete,
# apparently happens sometimes with
# github zips
import zipfile
fileh = zipfile.ZipFile(extraction_filename, 'r')
root_directory = fileh.filelist[0].filename.split('/')[0]
Expand Down

0 comments on commit f506459

Please sign in to comment.