Skip to content
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

[Regression]: EventEmitter.listeners("foo") throws if no listener exists #103

Closed
mxschmitt opened this issue Jan 17, 2022 · 2 comments · Fixed by #104
Closed

[Regression]: EventEmitter.listeners("foo") throws if no listener exists #103

mxschmitt opened this issue Jan 17, 2022 · 2 comments · Fixed by #104

Comments

@mxschmitt
Copy link
Contributor

The following:

from pyee import EventEmitter
ee = EventEmitter()
ee.listeners("foo")

results in:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../env/lib/python3.10/site-packages/pyee/base.py", line 229, in listeners
    return list(self._events[event].keys())
KeyError: 'foo'
>>> 

since version 9.0.0. In version <8 it was returning an empty list instead. This most likely broke in #99 when the defaultdict of EventEmitter._events got changed to a normal dict.

@jfhbrook
Copy link
Owner

Yeah, sounds like a regression. I'll patch shortly.

@jfhbrook
Copy link
Owner

Released your patch as 9.0.1 - thanks so much!!

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

Successfully merging a pull request may close this issue.

2 participants