Skip to content

Commit 1d167aa

Browse files
authored
Merge branch 'main' into 3.13-support
2 parents fda71cf + f82f936 commit 1d167aa

File tree

5 files changed

+57
-10
lines changed

5 files changed

+57
-10
lines changed

CHANGES.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,31 @@ Coming in build 307, as yet unreleased
1515
--------------------------------------
1616

1717
### pywin32
18+
* Fixed accidentally trying to raise a `str` instead of an `Exception` in (#2270, @Avasam)
19+
* `Pythonwin/pywin/debugger/debugger.py`
20+
* `Pythonwin/pywin/framework/dlgappcore.py`
21+
* `com/win32com/server/policy.py`
22+
* `win32/Lib/regutil.py`
23+
* `win32/scripts/VersionStamp/vssutil.py`
24+
* Removed the following unused symbols. They were meant to be used as Exceptions, but were accidentally strings (#2270, #2269, @Avasam)
25+
* `pywin.debugger.debugger.error`
26+
* `pywin.framework.dlgappcore.error`
27+
* `win32com.server.policy.error`
28+
* `regutil.error`
29+
* `win32.scripts.VersionStamp.vssutil.error`
30+
* `win32com.universal.com_error`
31+
* `win32com.client.build.error`
32+
* `win32com.client.genpy.error`
33+
* Add EnumDesktopWindows (#2219, @CristiFati)
34+
* Marked `exc_type` and `exc_traceback` in `win32comext.axscript.client.error.AXScriptException.__init__` as deprecated. (#2236 , @Avasam)
35+
They are now unused and all information is taken from the `exc_value` parameter.
36+
* Fixed non-overriden `pywin.scintilla.formatter.Formatter.ColorizeString` raising `TypeError` instead of `RuntimeError` due to too many parameters (#2216, @Avasam)
37+
* Fixed broken since Python 3 tokenization in `win32comext.axdebug.codecontainer.pySourceCodeContainer.GetSyntaxColorAttributes` (#2216, @Avasam)
38+
* Fixed a `TypeError` due to incorrect kwargs in `win32comext.axscript.client.pydumper.Register` (#2216, @Avasam)
39+
* Fixed error reporting of file copy failure for for installing debug dlls (#2216, @Avasam)
40+
* Fixed `py.exe -m win32verstamp` command and other quote typos caused by Implied String Concatenation (#2225, @Avasam)
41+
* Fixed tons of quote-related typos in strings, docs and comments (#2271 , @Avasam)
42+
* Fixed VT_SAFEARRAY(VT_RECORD) which were missing the last element (#2247)
1843
* Fixed `MFC redist DLLs not found` by preferring corresponding version but accepting different version (#2248, @andreabravetti)
1944
* Fixed `pywintypes.error: (5, 'RegOpenKeyEx', 'Access is denied.')` when running service with debug parameter and no elevation (#2238, @jmartens)
2045
* Fixed handling of `SyntaxError` exception from a Windows Scripting Host Python Script on Python 3.10+ (#2235, @nbbeatty)

com/win32com/test/testPyComTest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,10 @@ def TestCounter(counter, bIsGenerated):
625625
counter.SetBounds(bounds[0], bounds[1])
626626

627627
for item in counter:
628-
num = num + 1
628+
num += 1
629629
assert num == len(
630630
counter
631-
), "*** Length of counter and loop iterations dont match ***"
631+
), "*** Length of counter and loop iterations don't match ***"
632632
assert num == 10, "*** Unexpected number of loop iterations ***"
633633

634634
try:
@@ -640,7 +640,7 @@ def TestCounter(counter, bIsGenerated):
640640
counter.Reset()
641641
num = 0
642642
for item in counter:
643-
num = num + 1
643+
num += 1
644644
assert num == 10, f"*** Unexpected number of loop iterations - got {num} ***"
645645
progress("Finished testing counter")
646646

com/win32com/test/testvb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def TestVB(vbtest, bUseGenerated):
118118
assert (
119119
vbtest.VariantPutref._oleobj_ == vbtest._oleobj_
120120
), "Could not set the VariantPutref property correctly."
121-
# Cant test further types for this VariantPutref, as only
121+
# Can't test further types for this VariantPutref, as only
122122
# COM objects can be stored ByRef.
123123

124124
# A "set" type property - only works for generated.

com/win32comext/axscript/client/framework.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,19 +1202,19 @@ def HandleException(self, codeBlock: AXScriptCodeBlock | None) -> NoReturn:
12021202
# likely to have originated from the script code itself, and therefore
12031203
# needs to be reported like any other exception.
12041204
if IsCOMServerException(exc_type):
1205-
# Ensure the traceback doesnt cause a cycle.
1205+
# Ensure the traceback doesn't cause a cycle.
12061206
raise
12071207
# It could be an error by another script.
12081208
if (
12091209
isinstance(exc_value, pythoncom.com_error)
12101210
and exc_value.hresult == axscript.SCRIPT_E_REPORTED
12111211
):
1212-
# Ensure the traceback doesnt cause a cycle.
1212+
# Ensure the traceback doesn't cause a cycle.
12131213
raise COMException(scode=exc_value.hresult)
12141214

12151215
exception = error.AXScriptException(self, codeBlock, exc_value=exc_value)
12161216

1217-
# Ensure the traceback doesnt cause a cycle.
1217+
# Ensure the traceback doesn't cause a cycle.
12181218
result_exception = error.ProcessAXScriptException(
12191219
self.scriptSite, self.debugManager, exception
12201220
)

ruff.toml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@ target-version = "py37" # Target the oldest supported version
44
select = [
55
"I", # isort
66
"PLC", # Pylint Convention
7+
"PLE", # Pylint Error
8+
"RSE", # flake8-raise
9+
"W", # pycodestyle Warning
10+
"YTT", # flake8-2020
11+
12+
# String formatting, concatenating, interpolation, ...
13+
"FLY", # static-join-to-f-string
14+
"G", # flake8-logging-format
15+
# Note, we still want to allow multiline ISC
16+
"ISC001", # single-line-implicit-string-concatenation
17+
"UP025", # Remove unicode literals from strings
18+
"UP030", # Use implicit references for positional format fields
19+
# TODO: Still lots of manual fixes needed
20+
# "UP031", # Use format specifiers instead of percent format
21+
# "UP032", # Use f-string instead of format call
22+
23+
# Ensure modern type annotation syntax and best practices
24+
# Not including those covered by type-checkers
25+
"FA", # flake8-future-annotations
26+
"F404", # late-future-import
27+
"PYI", # flake8-pyi
28+
"UP006", # non-pep585-annotation
29+
"UP007", # non-pep604-annotation
30+
"UP010", # unnecessary-future-import
31+
"UP037", # quoted-annotation
732
]
833

934
[lint.per-file-ignores]
@@ -23,6 +48,3 @@ known-third-party = [
2348
"distutils",
2449
]
2550
extra-standard-library = ["setuptools"]
26-
27-
[lint.flake8-implicit-str-concat]
28-
allow-multiline = false # ignore ISC003 with this option disabled

0 commit comments

Comments
 (0)