aboutsummaryrefslogtreecommitdiff
path: root/src/IRCBot.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-02-25 10:36:17 +0000
committerGravatar jesopo2019-02-25 10:36:17 +0000
commitd627ed49e22ba9c57e50cd6de748a9f26fc03720 (patch)
tree3ca7f6397b2108d620314a849402c566e5dfc79c /src/IRCBot.py
parentMinor 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.py3
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