]> xmof Git - DeDRM.git/commitdiff
Old style exceptions are syntax errors in Python 3
authorChristian Clauss <cclauss@me.com>
Sun, 27 Sep 2020 23:00:21 +0000 (01:00 +0200)
committerGitHub <noreply@github.com>
Sun, 27 Sep 2020 23:00:21 +0000 (01:00 +0200)
Switch to new style exceptions which work on both Python 2 and Python 3.

DeDRM_plugin/ignoblepdf.py

index 33e84b1d9d0fd5302631392b09e4f68aa8abccf4..2b193cb728d1882d07b45eca93238c4f04d3c2a5 100644 (file)
@@ -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: