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 c6a3777..786b072 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