summaryrefslogtreecommitdiffstats
path: root/Lib/logging/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/logging/__init__.py')
-rw-r--r--Lib/logging/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 9780c83..f932110 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1396,6 +1396,10 @@ def basicConfig(**kwargs):
root.addHandler(hdlr)
level = kwargs.get("level")
if level is not None:
+ if str(level) == level: # If a string was passed, do more checks
+ if level not in _levelNames:
+ raise ValueError("Unknown level: %r" % level)
+ level = _levelNames[level]
root.setLevel(level)
#---------------------------------------------------------------------------