From c899ae080531e0e149d0439d710ea106b522aa91 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 28 Oct 2018 19:03:32 +0100 Subject: [PATCH] add else condition for twisted reactor --- src/main/python/lbrynetservice.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/python/lbrynetservice.py b/src/main/python/lbrynetservice.py index d98cce6a..5aa1bbe6 100644 --- a/src/main/python/lbrynetservice.py +++ b/src/main/python/lbrynetservice.py @@ -2,6 +2,15 @@ import sys from twisted.internet import asyncioreactor if 'twisted.internet.reactor' not in sys.modules: asyncioreactor.install() +else: + from twisted.internet import reactor + if not isinstance(reactor, asyncioreactor.AsyncioSelectorReactor) and getattr(sys, 'frozen', False): + # pyinstaller hooks install the default reactor before + # any of our code runs, see kivy for similar problem: + # https://github.com/kivy/kivy/issues/4182 + del sys.modules['twisted.internet.reactor'] + asyncioreactor.install() + from twisted.internet import reactor import keyring.backend import platform @@ -81,7 +90,6 @@ keyring.set_keyring(LbryAndroidKeyring()) import logging.handlers from lbrynet.core import log_support -from twisted.internet import defer, reactor from lbrynet import analytics from lbrynet import conf