Only take the performance hit of banning PyQt4 imports on non frozen calibre installs

This commit is contained in:
Kovid Goyal 2014-08-15 17:19:05 +05:30
parent b3b7918e5a
commit 8a758b9c82

View File

@ -16,7 +16,7 @@ __builtin__.__dict__['_'] = lambda s: s
# immediately translated to the environment language
__builtin__.__dict__['__'] = lambda s: s
from calibre.constants import iswindows, preferred_encoding, plugins, isosx, islinux
from calibre.constants import iswindows, preferred_encoding, plugins, isosx, islinux, isfrozen
_run_once = False
winutil = winutilerror = None
@ -24,6 +24,7 @@ winutil = winutilerror = None
if not _run_once:
_run_once = True
if not isfrozen:
# Prevent PyQt4 from being loaded
class PyQt4Ban(object):