Skip to content

Commit 17f4769

Browse files
shailshouryyapitrou
authored andcommitted
Fix multiline f-string formatting
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
1 parent f4fee12 commit 17f4769

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/multiprocessing/resource_tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def main(fd):
223223
try:
224224
warnings.warn(
225225
f'resource_tracker: There appear to be {len(rtype_cache)} '
226-
'leaked {rtype} objects to clean up at shutdown: {rtype_cache}'
226+
f'leaked {rtype} objects to clean up at shutdown: {rtype_cache}'
227227
)
228228
except Exception:
229229
pass

0 commit comments

Comments
 (0)