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.
This commit is contained in:
C-Duv 2018-01-11 14:44:27 +01:00 committed by GitHub
parent e1ad2d3e5f
commit f5aeab9e26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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