From: Christian Heller Date: Fri, 5 Feb 2016 10:16:14 +0000 (+0100) Subject: Fix bugs in twt integration. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/%7B%7Bdb.prefix%7D%7D/calendar?a=commitdiff_plain;h=1961e9f73924c2b27625bdb31545e93ab5e49f89;p=plomlombot-irc.git Fix bugs in twt integration. --- diff --git a/plomlombot.py b/plomlombot.py index c6a3777..786b072 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -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