]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107710: Speed up `logging.getHandlerNames` function (#107711)
authorNikita Sobolev <mail@sobolevn.me>
Mon, 7 Aug 2023 13:52:36 +0000 (16:52 +0300)
committerGitHub <noreply@github.com>
Mon, 7 Aug 2023 13:52:36 +0000 (14:52 +0100)
Lib/logging/__init__.py
Misc/NEWS.d/next/Library/2023-08-07-14-24-42.gh-issue-107710.xfOCfj.rst [new file with mode: 0644]

index 46e86cb87ecfcbe2d037b2d20e71888e57087a46..527fc5c631730a8a126605cfe91b6c707e5b9193 100644 (file)
@@ -916,8 +916,7 @@ def getHandlerNames():
     """
     Return all known handler names as an immutable set.
     """
-    result = set(_handlers.keys())
-    return frozenset(result)
+    return frozenset(_handlers)
 
 
 class Handler(Filterer):
diff --git a/Misc/NEWS.d/next/Library/2023-08-07-14-24-42.gh-issue-107710.xfOCfj.rst b/Misc/NEWS.d/next/Library/2023-08-07-14-24-42.gh-issue-107710.xfOCfj.rst
new file mode 100644 (file)
index 0000000..70f8b58
--- /dev/null
@@ -0,0 +1 @@
+Speed up :func:`logging.getHandlerNames`.