From 5bd02b78fb584fb340a5dd309bb65aebd3ecda64 2017-01-07 14:36:33 From: Srinivas Reddy Thatiparthy Date: 2017-01-07 14:36:33 Subject: [PATCH] clean up tools.py --- diff --git a/IPython/testing/tools.py b/IPython/testing/tools.py index 1779221..d08b893 100644 --- a/IPython/testing/tools.py +++ b/IPython/testing/tools.py @@ -322,15 +322,7 @@ def check_pairs(func, pairs): assert out == expected, pair_fail_msg.format(name, inp, expected, out) -if py3compat.PY3: - MyStringIO = StringIO -else: - # In Python 2, stdout/stderr can have either bytes or unicode written to them, - # so we need a class that can handle both. - class MyStringIO(StringIO): - def write(self, s): - s = py3compat.cast_unicode(s, encoding=DEFAULT_ENCODING) - super(MyStringIO, self).write(s) +MyStringIO = StringIO _re_type = type(re.compile(r''))