(self, obj)
| 1646 | return traceback.format_exception_only(exc)[-1].strip() |
| 1647 | |
| 1648 | def _getsourcelines(self, obj): |
| 1649 | # GH-103319 |
| 1650 | # inspect.getsourcelines() returns lineno = 0 for |
| 1651 | # module-level frame which breaks our code print line number |
| 1652 | # This method should be replaced by inspect.getsourcelines(obj) |
| 1653 | # once this bug is fixed in inspect |
| 1654 | lines, lineno = inspect.getsourcelines(obj) |
| 1655 | lineno = max(1, lineno) |
| 1656 | return lines, lineno |
| 1657 | |
| 1658 | # Collect all command help into docstring, if not run with -OO |
| 1659 |
no test coverage detected