Commit edd6ec2d authored by Berker Peksag's avatar Berker Peksag

Issue #22613: Fix reprlib.Repr subclass example on Python 3.

Reported by Jacques Ducasse.
parent 36d8ef9c
...@@ -148,10 +148,10 @@ for file objects could be added:: ...@@ -148,10 +148,10 @@ for file objects could be added::
import sys import sys
class MyRepr(reprlib.Repr): class MyRepr(reprlib.Repr):
def repr_file(self, obj, level):
if obj.name in ['<stdin>', '<stdout>', '<stderr>']: def repr_TextIOWrapper(self, obj, level):
if obj.name in {'<stdin>', '<stdout>', '<stderr>'}:
return obj.name return obj.name
else:
return repr(obj) return repr(obj)
aRepr = MyRepr() aRepr = MyRepr()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment