MCPcopy Create free account
hub / github.com/mhammond/pywin32 / _HandlePythonFailure

Function _HandlePythonFailure

Pythonwin/pywin/framework/scriptutils.py:551–565  ·  view source on GitHub ↗
(what, syntaxErrorPathName = None)

Source from the content-addressed store, hash-verified

549 return view
550
551def _HandlePythonFailure(what, syntaxErrorPathName = None):
552 typ, details, tb = sys.exc_info()
553 if isinstance(details, SyntaxError):
554 try:
555 msg, (fileName, line, col, text) = details
556 if (not fileName or fileName =="<string>") and syntaxErrorPathName:
557 fileName = syntaxErrorPathName
558 _JumpToPosition(fileName, line, col)
559 except (TypeError, ValueError):
560 msg = str(details)
561 win32ui.SetStatusText('Failed to ' + what + ' - syntax error - %s' % msg)
562 else:
563 traceback.print_exc()
564 win32ui.SetStatusText('Failed to ' + what + ' - ' + str(details) )
565 tb = None # Clean up a cycle.
566
567# Find the Python TabNanny in either the standard library or the Python Tools/Scripts directory.
568def FindTabNanny():

Callers 3

RunScriptFunction · 0.85
ImportFileFunction · 0.85
CheckFileFunction · 0.85

Calls 2

_JumpToPositionFunction · 0.85
SetStatusTextMethod · 0.45

Tested by

no test coverage detected