forked from LBRYCommunity/lbry-sdk
don't delete the reactor from sys.modules unless in a build
This commit is contained in:
parent
673d259d7a
commit
7dcebf99e0
1 changed files with 2 additions and 1 deletions
|
@ -4,12 +4,13 @@ if 'twisted.internet.reactor' not in sys.modules:
|
||||||
asyncioreactor.install()
|
asyncioreactor.install()
|
||||||
else:
|
else:
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
if not isinstance(reactor, asyncioreactor.AsyncioSelectorReactor):
|
if not isinstance(reactor, asyncioreactor.AsyncioSelectorReactor) and getattr(sys, 'frozen', False):
|
||||||
# pyinstaller hooks install the default reactor before
|
# pyinstaller hooks install the default reactor before
|
||||||
# any of our code runs, see kivy for similar problem:
|
# any of our code runs, see kivy for similar problem:
|
||||||
# https://github.com/kivy/kivy/issues/4182
|
# https://github.com/kivy/kivy/issues/4182
|
||||||
del sys.modules['twisted.internet.reactor']
|
del sys.modules['twisted.internet.reactor']
|
||||||
asyncioreactor.install()
|
asyncioreactor.install()
|
||||||
|
from twisted.internet import reactor
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
Loading…
Reference in a new issue