(what, syntaxErrorPathName = None)
| 549 | return view |
| 550 | |
| 551 | def _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. |
| 568 | def FindTabNanny(): |
no test coverage detected