Check harfbuzz fix is executed before PyQt is imported

This commit is contained in:
Florian Bruhin 2014-06-04 14:29:47 +02:00
parent cc27d42250
commit b9abb04e4e

View File

@ -24,6 +24,7 @@ import faulthandler
import textwrap
import traceback
import signal
import warnings
# Now we initialize the faulthandler as early as possible, so we theoretically
@ -63,6 +64,8 @@ def fix_harfbuzz(args):
Args:
args: The argparse namespace.
"""
if 'PyQt5' in sys.modules:
warnings.warn("Harfbuzz fix attempted but PyQt5 is already imported!")
if sys.platform.startswith('linux') and args.harfbuzz == 'auto':
os.environ['QT_HARFBUZZ'] = 'old'
elif args.harfbuzz == 'old':