Skip to content

Remove an unused local variable in Lib/code.py #135103

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

Closed
ChVeen opened this issue Jun 3, 2025 · 1 comment
Closed

Remove an unused local variable in Lib/code.py #135103

ChVeen opened this issue Jun 3, 2025 · 1 comment

Comments

@ChVeen
Copy link
Contributor

ChVeen commented Jun 3, 2025

In file Lib/code.py between lines 220-231 we have:

try:
	sys.ps1
	delete_ps1_after = False
except AttributeError:
	sys.ps1 = ">>> "
	delete_ps1_after = True
try:
	_ps2 = sys.ps2
	delete_ps2_after = False
except AttributeError:
	sys.ps2 = "... "
	delete_ps2_after = True

As can be seen in the code snippet the existence of sys.ps1 and sys.ps2 is checked using try except blocks.
But in the second case with an unused local variable _ps2.
In order to enhance the code quality I propose to unify the approach and remove this _ps2 because it is never used.

Linked PRs

@StanFromIreland
Copy link
Contributor

cc @methane This can be closed

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

No branches or pull requests

3 participants