diff options
| author | 2019-06-22 12:21:44 +0100 | |
|---|---|---|
| committer | 2019-06-22 12:21:44 +0100 | |
| commit | 3eac36d0f54959b9708bfdabac490a38255255e5 (patch) | |
| tree | 20afe24df96631b10df7b1da0c4cd154a017410e /src/EventManager.py | |
| parent | Change 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.py | 3 |
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] |
