One function

Notifier in pycqa/flake8

The author described this change as Fix Notifier.listeners_for. It counts as a record because the check below fails on the code as it stood at 58b2ca69e and passes on 98357e71d, with nothing else changed between the two runs.

Fix saved2016-02-20
Sharing licenceMIT · LICENSE
Change size+2 1

What the code was meant to do, written into the code itself as a docstring

Object that tracks and notifies listener objects.

The change

2727 path = error_code
2828 while path:
2929 node = self.listeners.find(path)
30- for listener in node.data:
30+ listeners = getattr(node, 'data', [])
31+ for listener in listeners:
3132 yield listener
3233 path = path[:-1]
3334

The check that tells the two apart

failpass·tests/unit/test_notifier.py::TestNotifier::test_no_listeners_for[W123]

Check file tests/unit/test_notifier.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it58b2ca69e466ed8669d830dc6a95fc32363448d7
Broken version dated2016-02-19
Moduleflake8.plugins.notifier
Units changedNotifier
Fingerprint04db440bc8c7654d
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in pycqa/flake8