[New-bugs-announce] [issue18666] Unused variable in test_frame.py

Vajrasky Kok report at bugs.python.org
Tue Aug 6 07:01:37 CEST 2013

New submission from Vajrasky Kok:

There is a unused variable in Lib/test/test_frame.py.

    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.

components: Tests
files: test_frame.patch
keywords: patch
messages: 194524
nosy: pitrou, vajrasky
priority: normal
severity: normal
status: open
title: Unused variable in test_frame.py
versions: Python 3.4
Added file: http://bugs.python.org/file31170/test_frame.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list