bpo-39994: Fix pprint handling of dict subclasses that override __repr__ (GH-21892)

Co-authored-by: Palak Kumar Jha
This commit is contained in:
Irit Katriel 2020-08-30 18:29:53 +01:00 committed by GitHub
parent 92c38164a4
commit 582f13786b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 7 deletions

View file

@ -176,12 +176,6 @@ class PrettyPrinter:
p(self, object, stream, indent, allowance, context, level + 1)
del context[objid]
return
elif isinstance(object, dict):
context[objid] = 1
self._pprint_dict(object, stream, indent, allowance,
context, level + 1)
del context[objid]
return
stream.write(rep)
_dispatch = {}