Skip to content

Commit 6c7faf3

Browse files
authored
Skip expensive repr() in logging call when not needed (#16350)
We were spending quite a lot of time in this function when running tests, based on profiling.
1 parent 93d4cb0 commit 6c7faf3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypy/build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ def _build(
255255
stdout=stdout,
256256
stderr=stderr,
257257
)
258-
manager.trace(repr(options))
258+
if manager.verbosity() >= 2:
259+
manager.trace(repr(options))
259260

260261
reset_global_state()
261262
try:

0 commit comments

Comments
 (0)