Fix AttributeError exception in log.py with python3.4

This commit is contained in:
Sergio Conde 2014-04-01 20:16:20 +02:00
parent 0f3a159a60
commit ad3deb7c21

View File

@ -208,8 +208,11 @@ class ValidLogLevel(registry.String):
minimumLevel = -1 minimumLevel = -1
def set(self, s): def set(self, s):
s = s.upper() s = s.upper()
try:
try: try:
level = logging._levelNames[s] level = logging._levelNames[s]
except AttributeError:
level = logging._nameToLevel[s]
except KeyError: except KeyError:
try: try:
level = int(s) level = int(s)