diff options
| author | 2019-02-25 10:36:17 +0000 | |
|---|---|---|
| committer | 2019-02-25 10:36:17 +0000 | |
| commit | d627ed49e22ba9c57e50cd6de748a9f26fc03720 (patch) | |
| tree | 3ca7f6397b2108d620314a849402c566e5dfc79c /src/IRCBot.py | |
| parent | Minor code stylisation in imgur.py (diff) | |
| signature | ||
Pull "is main thread" logic out to utils, force Database to be accessed on main
thread
Diffstat (limited to 'src/IRCBot.py')
| -rw-r--r-- | src/IRCBot.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/IRCBot.py b/src/IRCBot.py index 2733db1f..c5809d42 100644 --- a/src/IRCBot.py +++ b/src/IRCBot.py @@ -38,7 +38,8 @@ class Bot(object): func: typing.Optional[typing.Callable[[], typing.Any]]=None ) -> typing.Any: func = func or (lambda: None) - if threading.current_thread() is threading.main_thread(): + + if utils.is_main_thread(): returned = func() self._trigger_client.send(b"TRIGGER") return returned |
