home · contact · privacy
Fix bugs in twt integration.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 5 Feb 2016 10:16:14 +0000 (11:16 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 5 Feb 2016 10:16:14 +0000 (11:16 +0100)
plomlombot.py

index c6a3777407c6dbceaffaf36c3d034bc400667a6a..786b072bf483d1c69cfd19e18c18895214bbbf6b 100755 (executable)
@@ -247,13 +247,13 @@ def handle_command(command, argument, notice, target, session):
         def try_open(mode):
             try:
                 twtfile = open(session.twtfile, "w")
-            except PermissionError, FileNotFoundError:
-                notice("CAN'T ACCESS OR CREATE TWT FILE.")
+            except (PermissionError, FileNotFoundError) as err:
+                notice("CAN'T ACCESS OR CREATE TWT FILE: " + str(err))
                 return None
             return twtfile
 
         from datetime import datetime
-        if not os.access(path, os.F_OK):
+        if not os.access(session.twtfile, os.F_OK):
             twtfile = try_open("w")
             if None == twtfile:
                 return