Skip to content

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

Closed
@ChVeen

Description

@ChVeen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions