Skip to content

Commit 52ed4b9

Browse files
use the default logging lastResort instead of a own hackish copy
closes #1139
1 parent 664a55a commit 52ed4b9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
- fix #324: document/recommend the v tag prefix
4040
- fix #501: add py.typed
4141
- fix #804: git - use fallback version instead of 0.0 when no version is found at all
42+
- fix #1139: use logging.lastResort instead of a own replica to avoid polluting logging._handlerList
4243

4344
## v8.3.1
4445

src/setuptools_scm/_log.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ def make_default_handler() -> logging.Handler:
3939

4040
return RichHandler(console=console)
4141
except ImportError:
42-
handler = AlwaysStdErrHandler()
43-
handler.setFormatter(logging.Formatter("%(levelname)s %(name)s %(message)s"))
44-
return handler
42+
last_resort = logging.lastResort
43+
assert last_resort is not None
44+
return last_resort
4545

4646

4747
_default_handler = make_default_handler()

0 commit comments

Comments
 (0)