Skip to content

Commit

Permalink
Fix multiline f-string formatting
Browse files Browse the repository at this point in the history
The previously used f-string format did not properly interpolate the
variables, and resulted in an output such as the following:

```
/Users/username/cpython/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 6 leaked {rtype} objects to clean up at shutdown: {rtype_cache}
```

Resource: https://stackoverflow.com/questions/49416042/how-to-write-an-f-string-on-multiple-lines-without-introducing-unintended-whites
  • Loading branch information
shailshouryya committed Jul 25, 2023
1 parent 819915e commit 1611dd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/multiprocessing/resource_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def main(fd):
try:
warnings.warn(
f'resource_tracker: There appear to be {len(rtype_cache)} '
'leaked {rtype} objects to clean up at shutdown: {rtype_cache}'
f'leaked {rtype} objects to clean up at shutdown: {rtype_cache}'
)
except Exception:
pass
Expand Down

0 comments on commit 1611dd4

Please sign in to comment.