Skip to content

gh-152558: Avoid redundant quoting in subprocess.TimeoutExpired.__str__#152559

Open
lpyu001 wants to merge 2 commits into
python:mainfrom
lpyu001:fix-redundant-quotes
Open

gh-152558: Avoid redundant quoting in subprocess.TimeoutExpired.__str__#152559
lpyu001 wants to merge 2 commits into
python:mainfrom
lpyu001:fix-redundant-quotes

Conversation

@lpyu001

@lpyu001 lpyu001 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@lpyu001 lpyu001 requested a review from gpshead as a code owner June 29, 2026 08:36
@lpyu001 lpyu001 changed the title gh-152558: Avoid redundant quoting in :exc:`subprocess.TimeoutExpired… gh-152558: Avoid redundant quoting in `subprocess.TimeoutExpired‘ Jun 29, 2026
@lpyu001 lpyu001 changed the title gh-152558: Avoid redundant quoting in `subprocess.TimeoutExpired‘ gh-152558: Avoid redundant quoting in subprocess.TimeoutExpired Jun 29, 2026
@lpyu001 lpyu001 changed the title gh-152558: Avoid redundant quoting in subprocess.TimeoutExpired gh-152558: Avoid redundant quoting in subprocess.TimeoutExpired.__str__ Jun 29, 2026
Comment thread Lib/subprocess.py Outdated
Comment on lines 183 to 184
return ("Command %r timed out after %s seconds" %
(self.cmd, self.timeout))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return ("Command %r timed out after %s seconds" %
(self.cmd, self.timeout))
return f"Command {self.cmd!r} timed out after {self.timeout} seconds"

We can convert this to an f-string.

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