add else condition for twisted reactor

This commit is contained in:
Akinwale Ariwodola 2018-10-28 19:03:32 +01:00
parent 9b303b38c7
commit c899ae0805

View file

@ -2,6 +2,15 @@ import sys
from twisted.internet import asyncioreactor from twisted.internet import asyncioreactor
if 'twisted.internet.reactor' not in sys.modules: if 'twisted.internet.reactor' not in sys.modules:
asyncioreactor.install() 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 keyring.backend
import platform import platform
@ -81,7 +90,6 @@ keyring.set_keyring(LbryAndroidKeyring())
import logging.handlers import logging.handlers
from lbrynet.core import log_support from lbrynet.core import log_support
from twisted.internet import defer, reactor
from lbrynet import analytics from lbrynet import analytics
from lbrynet import conf from lbrynet import conf