1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-16 06:57:12 +00:00

use condition rather than try/catch

This commit is contained in:
林檎
2017-03-06 13:42:00 +08:00
parent 6e3d4877ed
commit 4dfa157161
2 changed files with 7 additions and 5 deletions

View File

@@ -1052,8 +1052,10 @@ def stats():
stdin=subprocess.PIPE)
p.wait()
for lines in p.stdout.readlines():
if re.search('Amazon kindlegen\(', str(lines)):
versions['KindlegenVersion'] = str(lines)
if type(lines) is bytes:
lines = lines.decode('utf-8')
if re.search('Amazon kindlegen\(', lines):
versions['KindlegenVersion'] = lines
versions['PythonVersion'] = sys.version
versions['babel'] = babelVersion
versions['sqlalchemy'] = sqlalchemyVersion