diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-22 16:50:08 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-22 16:50:08 +0200 |
commit | eb89a5252aef7f2bd8259b5dcbfadd4b007c311e (patch) | |
tree | 6c434c39a17be10379190702bea9803a88ff1ad0 | |
parent | c55759e0011f31123872ff385f0f87bba4c9f3fd (diff) | |
download | poezio-eb89a5252aef7f2bd8259b5dcbfadd4b007c311e.tar.gz poezio-eb89a5252aef7f2bd8259b5dcbfadd4b007c311e.tar.bz2 poezio-eb89a5252aef7f2bd8259b5dcbfadd4b007c311e.tar.xz poezio-eb89a5252aef7f2bd8259b5dcbfadd4b007c311e.zip |
logger: Use an option_fd when we know open can fail.
-rw-r--r-- | poezio/logger.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/poezio/logger.py b/poezio/logger.py index e341af03..9ca7120e 100644 --- a/poezio/logger.py +++ b/poezio/logger.py @@ -192,9 +192,10 @@ class Logger: if jid in self._fds.keys(): fd = self._fds[jid] else: - fd = self._check_and_create_log_dir(jid) - if not fd: - return True + option_fd = self._check_and_create_log_dir(jid) + if option_fd is None: + return True + fd = option_fd filename = log_dir / jid try: fd.write(logged_msg) |