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__.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 645e0b3..62a87a7 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -2024,10 +2024,9 @@ def getLogger(name=None):
If no name is specified, return the root logger.
"""
- if name:
- return Logger.manager.getLogger(name)
- else:
+ if not name or isinstance(name, str) and name == root.name:
return root
+ return Logger.manager.getLogger(name)
def critical(msg, *args, **kwargs):
"""