aboutsummaryrefslogtreecommitdiff
path: root/src/EventManager.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-22 12:21:44 +0100
committerGravatar jesopo2019-06-22 12:21:44 +0100
commit3eac36d0f54959b9708bfdabac490a38255255e5 (patch)
tree20afe24df96631b10df7b1da0c4cd154a017410e /src/EventManager.py
parentChange raw.send and raw.receive commands to just pass around ParsedLines (diff)
signature
Restrict EventManager calls to the main thread
Diffstat (limited to 'src/EventManager.py')
-rw-r--r--src/EventManager.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/EventManager.py b/src/EventManager.py
index 52e9a517..dd04b370 100644
--- a/src/EventManager.py
+++ b/src/EventManager.py
@@ -192,6 +192,9 @@ class EventHook(object):
def _call(self, kwargs: dict, safe: bool, maximum: typing.Optional[int]
) -> typing.List[typing.Any]:
+ if not utils.is_main_thread():
+ raise RuntimeError("Can't call events outside of main thread")
+
event_path = self._get_path()
hooks = self.get_hooks()
returns = [] # type: typing.List[typing.Any]