Skip to content

Replaced by fstring - #702

Merged
junkmd merged 1 commit into
enthought:mainfrom
newwingbird:fstring-3
Dec 16, 2024
Merged

junkmd merged 1 commit into
enthought:mainfrom
newwingbird:fstring-3

Conversation

@newwingbird

Copy link
Copy Markdown
Contributor

Related to #657

The comtypes/tools/tlbparser.py had already been replaced by fstring.

junkmd added a commit to junkmd/pywinauto that referenced this pull request Dec 16, 2024
@junkmd junkmd added this to the 1.4.9 milestone Dec 16, 2024

@junkmd junkmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@junkmd
junkmd merged commit 93da17f into enthought:main Dec 16, 2024
@junkmd junkmd linked an issue Dec 16, 2024 that may be closed by this pull request
27 of 36 tasks
@junkmd

junkmd commented Dec 16, 2024 •

Copy link
Copy Markdown
Collaborator

@newwingbird

The comtypes/tools/tlbparser.py had already been replaced by fstring.

We are probably overlooking the following.

raise ValueError("calling convention %d" % fd.callconv)

-            print("_check_version(%r, %f)" % (version, tlib_mtime), file=output)
+            print(f"_check_version({version!r}, {tlib_mtime:f})", file=output)

Also, I found another place where we can switch to an f-string.

print("_check_version(%r, %f)" % (version, tlib_mtime), file=output)

-                raise ValueError("calling convention %d" % fd.callconv)
+                raise ValueError(f"calling convention {fd.callconv:d}")

It would be great if you could include this in the next PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor from % string formatting to f-strings in every module.

2 participants