Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed unbound global variables in pywin.dialogs.ideoptions.OptionsPropPage's OnFormat* methods #2283

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Coming in build 307, as yet unreleased
--------------------------------------

### pywin32
* Fixed unbound global variables in `pywin.dialogs.ideoptions.OptionsPropPage`'s `OnFormat*` methods (#2283, @Avasam)
* Add RealGetWindowClass (#2299, @CristiFati)
* Make it compile on Python 3.13 (#2260, @clin1234)
* Fixed accidentally trying to raise a `str` instead of an `Exception` in (#2270, @Avasam)
Expand Down
17 changes: 7 additions & 10 deletions Pythonwin/pywin/dialogs/ideoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,26 +114,23 @@ def ChangeFormat(self, fmtAttribute, fmt):
def OnFormatTitle(self, command, code):
fmt = self.GetFormat(interact.formatTitle)
if fmt:
formatTitle = fmt
interact.formatTitle = fmt
interact.SaveFontPreferences()

def OnFormatInput(self, command, code):
global formatInput
fmt = self.GetFormat(formatInput)
fmt = self.GetFormat(interact.formatInput)
if fmt:
formatInput = fmt
interact.formatInput = fmt
interact.SaveFontPreferences()

def OnFormatOutput(self, command, code):
global formatOutput
fmt = self.GetFormat(formatOutput)
fmt = self.GetFormat(interact.formatOutput)
if fmt:
formatOutput = fmt
interact.formatOutput = fmt
interact.SaveFontPreferences()

def OnFormatError(self, command, code):
global formatOutputError
fmt = self.GetFormat(formatOutputError)
fmt = self.GetFormat(interact.formatOutputError)
if fmt:
formatOutputError = fmt
interact.formatOutputError = fmt
interact.SaveFontPreferences()
2 changes: 2 additions & 0 deletions adodbapi/process_connect_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def macro_call(macro_name, args, kwargs):
return new_key, platform.node()

elif macro_name == "getenv": # expand the server's environment variable args[1]
import os

try:
dflt = args[2] # if not found, default from args[2]
except IndexError: # or blank
Expand Down
3 changes: 1 addition & 2 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
"reportOptionalIterable": "warning",
"reportOptionalMemberAccess": "warning",
"reportOptionalSubscript": "warning",
// TODO: Leave Unbound/Undefined to their own PR(s)
"reportUnboundVariable": "warning",
// TODO: Leave Undefined to its own PR(s)
"reportUndefinedVariable": "warning",
// Too many dynamically generated modules. This will require type stubs to properly fix.
"reportMissingImports": "warning",
Expand Down
Loading