From 3b25c91c14d6d4e1280e7340ceb17c34ab77056e Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 5 Jul 2022 10:50:56 -0700 Subject: [PATCH 1/3] Fix _perfcheck in pprint.py Closes #92546 --- Lib/pprint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() From cec346082377b4526408b11fb1517972bfc0a19b Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 5 Jul 2022 11:09:18 -0700 Subject: [PATCH 2/3] Add NEWS entry --- .../next/Library/2022-07-05-11-09-14.gh-issue-92546.AvT2Ka.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2022-07-05-11-09-14.gh-issue-92546.AvT2Ka.rst 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..f8c742d2aa6ae4 --- /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` From 8761e991b55991dcc74c6251840d40cd08b31cc6 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Tue, 5 Jul 2022 11:13:27 -0700 Subject: [PATCH 3/3] Fix ReST in NEWS entry --- .../next/Library/2022-07-05-11-09-14.gh-issue-92546.AvT2Ka.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index f8c742d2aa6ae4..4df8c4f3f715bd 100644 --- 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 @@ -1,3 +1,3 @@ Fix bug where :meth:`pprint._perfcheck` calls :meth:`pprint.PrettyPrinter._safe_repr` with an extra argument causing -`TypeError` +``TypeError``