Skip to content

Commit

Permalink
Fix last reportUndefinedVariable error (#2326)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Oct 13, 2024
1 parent 6fa1b68 commit f01d67f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Coming in build 309, as yet unreleased

* Improved handling of dict iterations and fallbacks (removes Python 2 support code, small general speed improvement) (#2332, #2330, @Avasam)
* Fixed "Open GL Demo" (`Pythonwin/pywin/Demos/openGLDemo.py`) and restore "Font" demo in `Pythonwin/pywin/Demos/guidemo.py` (#2345, @Avasam)
* Fixed accidentally trying to raise an undefined name instead of an `Exception` in `Pythonwin/pywin/debugger/debugger.py` (#2326, @Avasam)

Build 308, released 2024-10-12
------------------------------
Expand Down
13 changes: 6 additions & 7 deletions Pythonwin/pywin/debugger/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,15 +869,14 @@ def RespondDebuggerState(self, state):
elif state == DBGSTATE_RUNNING: # Code is running under the debugger.
title = " - running"
elif state == DBGSTATE_BREAK: # We are at a breakpoint or stepping or whatever.
if self.bAtException:
if self.bAtPostMortem:
title = " - post mortem exception"
else:
title = " - exception"
else:
if not self.bAtException:
title = " - break"
elif self.bAtPostMortem:
title = " - post mortem exception"
else:
title = " - exception"
else:
raise error("Invalid debugger state passed!")
raise ValueError("Invalid debugger state passed!")
win32ui.GetMainFrame().SetWindowText(
win32ui.LoadString(win32ui.IDR_MAINFRAME) + title
)
Expand Down
3 changes: 1 addition & 2 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@
"reportOptionalSubscript": "warning",
// Needs fixes in types-pywin32 and requires Python 3.8 to annotate ambiguous global variables
"reportUnnecessaryComparison": "warning",
// TODO: Leave Unbound/Undefined to their own PR(s)
// TODO: Leave Unbound its own PR(s)
"reportUnboundVariable": "warning",
"reportUndefinedVariable": "warning",
// Too many dynamically generated modules. This will require type stubs to properly fix.
"reportMissingImports": "warning",
// IDEM, but happens when pywin32 is not in site-packages but module is found from typeshed.
Expand Down

0 comments on commit f01d67f

Please sign in to comment.