##// END OF EJS Templates
Convert source to native string before doing ANSI formatting....
Thomas Kluyver -
Show More
@@ -459,7 +459,7 b' class Inspector:'
459 459 # Source or docstring, depending on detail level and whether
460 460 # source found.
461 461 if detail_level > 0 and info['source'] is not None:
462 displayfields.append(("Source", info['source']))
462 displayfields.append(("Source", self.format(py3compat.unicode_to_str(info['source']))))
463 463 elif info['docstring'] is not None:
464 464 displayfields.append(("Docstring", info["docstring"]))
465 465
@@ -608,12 +608,11 b' class Inspector:'
608 608 source = None
609 609 try:
610 610 try:
611 src = getsource(obj,binary_file)
611 source = getsource(obj,binary_file)
612 612 except TypeError:
613 613 if hasattr(obj,'__class__'):
614 src = getsource(obj.__class__,binary_file)
615 if src is not None:
616 source = self.format(src)
614 source = getsource(obj.__class__,binary_file)
615 if source is not None:
617 616 out['source'] = source.rstrip()
618 617 except Exception:
619 618 pass
General Comments 0
You need to be logged in to leave comments. Login now