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-05-09-17-31-30.gh-issue-92546.1hbeQQ.rst b/Misc/NEWS.d/next/Library/2022-05-09-17-31-30.gh-issue-92546.1hbeQQ.rst new file mode 100644 index 00000000000000..d9b386a674a4f8 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-05-09-17-31-30.gh-issue-92546.1hbeQQ.rst @@ -0,0 +1,2 @@ +Fix invalid :meth:`PrettyPrinter._safe_repr` call when :mod:`pprint` is +executed as a script.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: