prevent traceback when parsing the log level

This commit is contained in:
Denis Fomin 2010-12-03 13:47:44 +03:00
parent 47d30eb973
commit 4f0300cd65
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ def parseLogLevel(arg):
""" """
if arg.isdigit(): if arg.isdigit():
return int(arg) return int(arg)
elif arg.isupper(): elif arg.isupper() and hasattr(logging, arg):
return getattr(logging, arg) return getattr(logging, arg)
else: else:
print _('%s is not a valid loglevel') % repr(arg) print _('%s is not a valid loglevel') % repr(arg)