MCPcopy Create free account
hub / github.com/ipython/ipython / BadStringIO

Class BadStringIO

IPython/utils/tests/test_io.py:69–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 """IOStream initializes from a file-like object missing attributes. """
68 # Cause a failure from getattr and dir(). (Issue #6386)
69 class BadStringIO(StringIO):
70 def __dir__(self):
71 attrs = super().__dir__()
72 attrs.append('name')
73 return attrs
74 with self.assertWarns(DeprecationWarning):
75 iostream = IOStream(BadStringIO())
76 iostream.write('hi, bad iostream\n')

Callers 1

test_IOStream_initMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_IOStream_initMethod · 0.68