From d627ed49e22ba9c57e50cd6de748a9f26fc03720 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 25 Feb 2019 10:36:17 +0000 Subject: Pull "is main thread" logic out to utils, force Database to be accessed on main thread --- src/IRCBot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/IRCBot.py') 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 -- cgit v1.3.1-10-gc9f91