Remove workarounds for zipimport threading bug

No longer needed as the new bypy freezing code does not use zipimport
This commit is contained in:
Kovid Goyal 2020-10-02 21:08:15 +05:30
parent fe478a2cee
commit 06a48034db
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 0 additions and 15 deletions

View File

@ -393,10 +393,6 @@ def identify(log, abort, # {{{
log('The log from individual plugins is below')
workers = [Worker(p, kwargs, abort) for p in plugins]
# Ensure Browser is imported to workaround threading bugs in zipimport on
# Windows
from calibre import browser
browser()
for w in workers:
w.start()

View File

@ -103,12 +103,6 @@ def cap_path(data):
return r'Software\calibre\%s\Capabilities' % data['capability_name']
def pre_import_extensions():
for program in default_programs():
ext_map = {ext.lower():guess_type('file.' + ext.lower())[0] for ext in extensions(program)}
ext_map = {ext:mt for ext, mt in iteritems(ext_map) if mt}
def register():
base = os.path.dirname(sys.executable)
@ -167,14 +161,9 @@ class Register(Thread):
def __init__(self, prefs):
Thread.__init__(self, name='RegisterDP')
self.prefs = prefs
pre_import_extensions()
self.start()
def run(self):
# make sure no imports happen in this thread as python's zipimport
# machinery is not thread safe and main GUI importing is happening
# in parallel
# https://bugs.python.org/issue38884
try:
self.do_register()
except Exception: