Show More
@@ -322,15 +322,7 b' def check_pairs(func, pairs):' | |||||
322 | assert out == expected, pair_fail_msg.format(name, inp, expected, out) |
|
322 | assert out == expected, pair_fail_msg.format(name, inp, expected, out) | |
323 |
|
323 | |||
324 |
|
324 | |||
325 | if py3compat.PY3: |
|
325 | MyStringIO = StringIO | |
326 | MyStringIO = StringIO |
|
|||
327 | else: |
|
|||
328 | # In Python 2, stdout/stderr can have either bytes or unicode written to them, |
|
|||
329 | # so we need a class that can handle both. |
|
|||
330 | class MyStringIO(StringIO): |
|
|||
331 | def write(self, s): |
|
|||
332 | s = py3compat.cast_unicode(s, encoding=DEFAULT_ENCODING) |
|
|||
333 | super(MyStringIO, self).write(s) |
|
|||
334 |
|
326 | |||
335 | _re_type = type(re.compile(r'')) |
|
327 | _re_type = type(re.compile(r'')) | |
336 |
|
328 |
General Comments 0
You need to be logged in to leave comments.
Login now