[vlc-commits] python: avoid mistakenly catching exception (#98)

Jonas Haag git at videolan.org
Sat Aug 3 19:08:09 CEST 2019


vlc/python | branch: master | Jonas Haag <jonas at lophus.org> | Sat Aug  3 19:07:00 2019 +0200| [eb3a4976bc72c3994696c7160b594880713f2a25] | committer: Olivier Aubert

python: avoid mistakenly catching exception (#98)


> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=eb3a4976bc72c3994696c7160b594880713f2a25
---

 generator/templates/override.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/generator/templates/override.py b/generator/templates/override.py
index 309fce0..93fc823 100644
--- a/generator/templates/override.py
+++ b/generator/templates/override.py
@@ -473,10 +473,11 @@ class EventManager:
                 """
                 try: # retrieve Python callback and arguments
                     call, args, kwds = self._callbacks[k]
-                     # deref event.contents to simplify callback code
-                    call(event.contents, *args, **kwds)
                 except KeyError:  # detached?
                     pass
+                else:
+                    # deref event.contents to simplify callback code
+                    call(event.contents, *args, **kwds)
             self._callback_handler = _callback_handler
             self._callbacks = {}
 



More information about the vlc-commits mailing list