Show More
@@ -84,7 +84,7 b' import re' | |||||
84 | import datetime |
|
84 | import datetime | |
85 | from collections import deque |
|
85 | from collections import deque | |
86 |
|
86 | |||
87 |
from IPython.utils.py3compat import |
|
87 | from IPython.utils.py3compat import PYPY, cast_unicode | |
88 | from IPython.utils.encoding import get_stream_enc |
|
88 | from IPython.utils.encoding import get_stream_enc | |
89 |
|
89 | |||
90 | from io import StringIO |
|
90 | from io import StringIO | |
@@ -108,15 +108,7 b' def _safe_getattr(obj, attr, default=None):' | |||||
108 | except Exception: |
|
108 | except Exception: | |
109 | return default |
|
109 | return default | |
110 |
|
110 | |||
111 | if PY3: |
|
111 | CUnicodeIO = StringIO | |
112 | CUnicodeIO = StringIO |
|
|||
113 | else: |
|
|||
114 | class CUnicodeIO(StringIO): |
|
|||
115 | """StringIO that casts str to unicode on Python 2""" |
|
|||
116 | def write(self, text): |
|
|||
117 | return super(CUnicodeIO, self).write( |
|
|||
118 | cast_unicode(text, encoding=get_stream_enc(sys.stdout))) |
|
|||
119 |
|
||||
120 |
|
112 | |||
121 | def pretty(obj, verbose=False, max_width=79, newline='\n', max_seq_length=MAX_SEQ_LENGTH): |
|
113 | def pretty(obj, verbose=False, max_width=79, newline='\n', max_seq_length=MAX_SEQ_LENGTH): | |
122 | """ |
|
114 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now