diff --git a/Lib/pprint.py b/Lib/pprint.py index 575688d8eb6f4a..a7f13f51347608 100644 --- a/Lib/pprint.py +++ b/Lib/pprint.py @@ -643,7 +643,7 @@ def _perfcheck(object=None): object = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000 p = PrettyPrinter() t1 = time.perf_counter() - p._safe_repr(object, {}, None, 0, True) + p._safe_repr(object, {}, None, 0) t2 = time.perf_counter() p.pformat(object) t3 = time.perf_counter() diff --git a/Misc/NEWS.d/next/Library/2022-07-05-11-09-14.gh-issue-92546.AvT2Ka.rst b/Misc/NEWS.d/next/Library/2022-07-05-11-09-14.gh-issue-92546.AvT2Ka.rst new file mode 100644 index 00000000000000..4df8c4f3f715bd --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-07-05-11-09-14.gh-issue-92546.AvT2Ka.rst @@ -0,0 +1,3 @@ +Fix bug where :meth:`pprint._perfcheck` calls +:meth:`pprint.PrettyPrinter._safe_repr` with an extra argument causing +``TypeError``