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