Skip to content

Commit 8fcee6b

Browse files
authored
gh-107710: Speed up logging.getHandlerNames function (#107711)
1 parent c399b5e commit 8fcee6b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/logging/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,7 @@ def getHandlerNames():
916916
"""
917917
Return all known handler names as an immutable set.
918918
"""
919-
result = set(_handlers.keys())
920-
return frozenset(result)
919+
return frozenset(_handlers)
921920

922921

923922
class Handler(Filterer):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Speed up :func:`logging.getHandlerNames`.

0 commit comments

Comments
 (0)