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

Replaced by fstring #702

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Replaced by fstring #702

merged 1 commit into from
Dec 16, 2024

Conversation

newwingbird
Copy link
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
Copy link
Collaborator

@junkmd junkmd left a comment

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
49 checks passed
@junkmd junkmd linked an issue Dec 16, 2024 that may be closed by this pull request
36 tasks
@junkmd
Copy link
Collaborator

junkmd commented Dec 16, 2024

@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