This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Unused variable in
Type: Stage: resolved
Components: Tests Versions: Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pitrou, python-dev, vajrasky
Priority: normal Keywords: patch

Created on 2013-08-06 05:01 by vajrasky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
test_frame.patch vajrasky, 2013-08-06 05:01 review
Messages (3)
msg194524 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-08-06 05:01
There is a unused variable in Lib/test/

    def test_clear_executing_generator(self):
        # Attempting to clear an executing generator frame is forbidden.
        endly = False
        def g():
            nonlocal endly
            except ZeroDivisionError as e:
                f = e.__traceback__.tb_frame
                with self.assertRaises(RuntimeError):
                with self.assertRaises(RuntimeError):
                yield f
                endly = True
        gen = g()
        f = next(gen)

The variable f is hanging without any purpose.

Attached the patch to give purpose to variable f.
msg194574 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-08-06 21:05
New changeset 34e1ecb8edd2 by Antoine Pitrou in branch 'default':
Issue #18666: improve test_frame a bit. Patch by Vajrasky Kok.
msg194575 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-08-06 21:05
Good idea, thank you!
Date User Action Args
2022-04-11 14:57:49adminsetgithub: 62866
2013-08-06 21:05:51pitrousetstatus: open -> closed
resolution: fixed
messages: + msg194575

stage: resolved
2013-08-06 21:05:31python-devsetnosy: + python-dev
messages: + msg194574
2013-08-06 05:01:37vajraskycreate