MCPcopy Index your code
hub / github.com/ipython/ipython / get_exception_only

Method get_exception_only

IPython/core/interactiveshell.py:2155–2162  ·  view source on GitHub ↗

Return as a string (ending with a newline) the exception that just occurred, without any traceback.

(self, exc_tuple=None)

Source from the content-addressed store, hash-verified

2153 print("UsageError: %s" % exc, file=sys.stderr)
2154
2155 def get_exception_only(self, exc_tuple=None):
2156 """
2157 Return as a string (ending with a newline) the exception that
2158 just occurred, without any traceback.
2159 """
2160 etype, value, tb = self._get_exc_info(exc_tuple)
2161 msg = traceback.format_exception_only(etype, value)
2162 return ''.join(msg)
2163
2164 def showtraceback(
2165 self,

Callers 3

showtracebackMethod · 0.95
system_rawMethod · 0.95
_user_obj_errorMethod · 0.45

Calls 1

_get_exc_infoMethod · 0.95

Tested by

no test coverage detected