[game-data-packager] 01/02: unzip: catch exception if pgm is missing in --verbose mode
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Mon Jun 22 11:08:56 UTC 2015
This is an automated email from the git hooks/post-receive script.
detiste-guest pushed a commit to branch master
in repository game-data-packager.
commit 978c4f881745dace2b6199cf1addff150c0581ba
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Mon Jun 22 12:33:43 2015 +0200
unzip: catch exception if pgm is missing in --verbose mode
---
game_data_packager/__init__.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index 1508523..12fcd0d 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -1539,12 +1539,14 @@ class GameData(object):
except UnicodeError:
print(comment.encode('ascii', 'replace').decode('ascii'))
if 'FILE_ID.DIZ' in zf.namelist():
+ id_diz = ''
try:
entryfile = zf.open('FILE_ID.DIZ')
id_diz = entryfile.read().decode(encoding, 'replace')
except NotImplementedError:
- id_diz = subprocess.check_output(['unzip', '-c','-q',
- found_name, 'FILE_ID.DIZ']).decode(encoding, 'replace')
+ if which('unzip'):
+ id_diz = subprocess.check_output(['unzip', '-c','-q',
+ found_name, 'FILE_ID.DIZ']).decode(encoding, 'replace')
try:
print(id_diz)
except UnicodeError:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git
More information about the Pkg-games-commits
mailing list