Show More
@@ -218,8 +218,8 b' class FormatterWarning(UserWarning):' | |||
|
218 | 218 | """Warning class for errors in formatters""" |
|
219 | 219 | |
|
220 | 220 | @decorator |
|
221 |
def |
|
|
222 |
""" |
|
|
221 | def catch_format_error(method, self, *args, **kwargs): | |
|
222 | """show traceback on failed format call""" | |
|
223 | 223 | try: |
|
224 | 224 | r = method(self, *args, **kwargs) |
|
225 | 225 | except NotImplementedError: |
@@ -322,7 +322,7 b' class BaseFormatter(Configurable):' | |||
|
322 | 322 | # Map (modulename, classname) pairs to the format functions. |
|
323 | 323 | deferred_printers = Dict(config=True) |
|
324 | 324 | |
|
325 |
@ |
|
|
325 | @catch_format_error | |
|
326 | 326 | def __call__(self, obj): |
|
327 | 327 | """Compute the format for an object.""" |
|
328 | 328 | if self.enabled: |
@@ -675,7 +675,7 b' class PlainTextFormatter(BaseFormatter):' | |||
|
675 | 675 | |
|
676 | 676 | #### FormatterABC interface #### |
|
677 | 677 | |
|
678 |
@ |
|
|
678 | @catch_format_error | |
|
679 | 679 | def __call__(self, obj): |
|
680 | 680 | """Compute the pretty representation of the object.""" |
|
681 | 681 | if not self.pprint: |
@@ -887,7 +887,7 b' class IPythonDisplayFormatter(BaseFormatter):' | |||
|
887 | 887 | _return_type = (type(None), bool) |
|
888 | 888 | |
|
889 | 889 | |
|
890 |
@ |
|
|
890 | @catch_format_error | |
|
891 | 891 | def __call__(self, obj): |
|
892 | 892 | """Compute the format for an object.""" |
|
893 | 893 | if self.enabled: |
General Comments 0
You need to be logged in to leave comments.
Login now