##// END OF EJS Templates
remove CUnicodeIO and replace it with StringIO
Srinivas Reddy Thatiparthy -
Show More
@@ -15,6 +15,7 b' import json'
15 import sys
15 import sys
16 import traceback
16 import traceback
17 import warnings
17 import warnings
18 from io import StringIO
18
19
19 from decorator import decorator
20 from decorator import decorator
20
21
@@ -655,11 +656,7 b' class PlainTextFormatter(BaseFormatter):'
655 if not self.pprint:
656 if not self.pprint:
656 return repr(obj)
657 return repr(obj)
657 else:
658 else:
658 # handle str and unicode on Python 2
659 stream = StringIO()
659 # io.StringIO only accepts unicode,
660 # cStringIO doesn't handle unicode on py2,
661 # StringIO allows str, unicode but only ascii str
662 stream = pretty.CUnicodeIO()
663 printer = pretty.RepresentationPrinter(stream, self.verbose,
660 printer = pretty.RepresentationPrinter(stream, self.verbose,
664 self.max_width, self.newline,
661 self.max_width, self.newline,
665 max_seq_length=self.max_seq_length,
662 max_seq_length=self.max_seq_length,
General Comments 0
You need to be logged in to leave comments. Login now