Old style exceptions are syntax errors in Python 3

Switch to new style exceptions which work on both Python 2 and Python 3.
pull/156/head
Christian Clauss 2020-09-28 01:00:21 +02:00 zatwierdzone przez GitHub
rodzic 3f644ddfd6
commit 1eaee6a0a8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -2018,7 +2018,7 @@ def decryptBook(userkey, inpath, outpath):
# help construct to make sure the method runs to the end
try:
serializer.dump(outf)
except Exception, e:
except Exception as e:
print("error writing pdf: {0}".format(e.args[0]))
return 2
return 0
@ -2138,7 +2138,7 @@ def gui_main():
self.status['text'] = "Decrypting..."
try:
decrypt_status = decryptBook(userkey, inpath, outpath)
except Exception, e:
except Exception as e:
self.status['text'] = "Error; {0}".format(e.args[0])
return
if decrypt_status == 0: