##// END OF EJS Templates
Work around bug in pprint.pformat. Closes gh-148
Fernando Perez -
Show More
@@ -193,7 +193,11 b' class DisplayHook(Configurable):'
193 193 """
194 194 try:
195 195 if self.shell.pprint:
196 result_repr = pformat(result)
196 try:
197 result_repr = pformat(result)
198 except:
199 # Work around possible bugs in pformat
200 result_repr = repr(result)
197 201 if '\n' in result_repr:
198 202 # So that multi-line strings line up with the left column of
199 203 # the screen, instead of having the output prompt mess up
@@ -163,7 +163,11 b' def result_display(self,arg):'
163 163 """
164 164
165 165 if self.pprint:
166 out = pformat(arg)
166 try:
167 out = pformat(arg)
168 except:
169 # Work around possible bugs in pformat
170 out = repr(arg)
167 171 if '\n' in out:
168 172 # So that multi-line strings line up with the left column of
169 173 # the screen, instead of having the output prompt mess up
General Comments 0
You need to be logged in to leave comments. Login now