Show More
@@ -77,14 +77,14 b' def test_io_init():' | |||||
77 | def test_IOStream_init(): |
|
77 | def test_IOStream_init(): | |
78 | """IOStream initializes from a file-like object missing attributes. """ |
|
78 | """IOStream initializes from a file-like object missing attributes. """ | |
79 | # Cause a failure from getattr and dir(). (Issue #6386) |
|
79 | # Cause a failure from getattr and dir(). (Issue #6386) | |
80 | class BadStringIO(StringIO): |
|
80 | class BadStringIO(stdlib_io.StringIO): | |
81 | def __dir__(self): |
|
81 | def __dir__(self): | |
82 | attrs = super(StringIO, self).__dir__() |
|
82 | attrs = super(BadStringIO, self).__dir__() | |
83 | attrs.append('name') |
|
83 | attrs.append('name') | |
84 | return attrs |
|
84 | return attrs | |
85 |
|
85 | |||
86 | iostream = IOStream(BadStringIO()) |
|
86 | iostream = IOStream(BadStringIO()) | |
87 | iostream.write('hi, bad iostream\n') |
|
87 | iostream.write(u'hi, bad iostream\n') | |
88 | assert not hasattr(iostream, 'name') |
|
88 | assert not hasattr(iostream, 'name') | |
89 |
|
89 | |||
90 | def test_capture_output(): |
|
90 | def test_capture_output(): |
General Comments 0
You need to be logged in to leave comments.
Login now