From 1eaee6a0a8ef75c1ff671775c1c3313b2b7d0e91 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 28 Sep 2020 01:00:21 +0200 Subject: [PATCH] Old style exceptions are syntax errors in Python 3 Switch to new style exceptions which work on both Python 2 and Python 3. --- DeDRM_plugin/ignoblepdf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DeDRM_plugin/ignoblepdf.py b/DeDRM_plugin/ignoblepdf.py index 33e84b1..2b193cb 100644 --- a/DeDRM_plugin/ignoblepdf.py +++ b/DeDRM_plugin/ignoblepdf.py @@ -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: