summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-24 11:35:05 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-24 11:35:05 +0100
commit0cf9188421d5c66ec0e2405854e5e06b610218be (patch)
tree855c7726410d87777006c7c68eff5b81221ef9f2
parentd2a7be158191fb1bc8733ac09ecfb5dcbc14716b (diff)
downloadpykolab-0cf9188421d5c66ec0e2405854e5e06b610218be.tar.gz
Make sure a -d option value that is not an integer is just skipped entirely
-rw-r--r--pykolab/logger.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pykolab/logger.py b/pykolab/logger.py
index e16c6eb..6f82d5d 100644
--- a/pykolab/logger.py
+++ b/pykolab/logger.py
@@ -41,7 +41,11 @@ class Logger(logging.Logger):
if hasattr(sys, 'argv'):
for arg in sys.argv:
if debuglevel == -1:
- debuglevel = int(arg)
+ try:
+ debuglevel = int(arg)
+ except ValueError, errmsg:
+ continue
+
loglevel = logging.DEBUG
break