From f5aeab9e26fe391ae76aafdb4195c65bc2884e34 Mon Sep 17 00:00:00 2001 From: C-Duv <1466273+C-Duv@users.noreply.github.com> Date: Thu, 11 Jan 2018 14:44:27 +0100 Subject: [PATCH] Makes the timeout option optional The `--timeout` / `-t` option was made mandatory (by code) when introduced. Omitting the option would cause a `KeyError: 'timeout`. This commit makes it optional by adding a default value (of 60) when option is not given. --- imapbackup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imapbackup.py b/imapbackup.py index 6151f4f..465c911 100644 --- a/imapbackup.py +++ b/imapbackup.py @@ -536,6 +536,8 @@ def get_config(): config['port'] = 993 else: config['port'] = 143 + if not 'timeout' in config: + config['timeout'] = 60 # done! return config