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

use f-string #448

Merged
merged 2 commits into from
Feb 4, 2020
Merged

use f-string #448

merged 2 commits into from
Feb 4, 2020

Conversation

dirk-thomas
Copy link
Member

CI builds in ament/ament_package#112.

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
@dirk-thomas dirk-thomas self-assigned this Feb 1, 2020
@@ -140,16 +136,13 @@ def call_get_parameters(*, node, node_name, parameter_names):
if response is None:
e = future.exception()
raise RuntimeError(
'Exception while calling service of node '
"'{args.node_name}': {e}".format_map(locals()))
f"Exception while calling service of node '{node_name}': {e}")
Copy link
Member Author

Choose a reason for hiding this comment

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

Great example why f-strings are better: this bug was catched by the linters (before the string contained args.node_name but args isn't a variable in the current scope.

Same below in old line 170 / new line 162.

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM

@dirk-thomas dirk-thomas merged commit 1d1747c into master Feb 4, 2020
@delete-merged-branch delete-merged-branch bot deleted the dirk-thomas/use-f-string branch February 4, 2020 05:01
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.

2 participants