From a42caf4532818163fc88209b07f37e669ad932ff Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 9 Jan 2022 14:59:34 +0000 Subject: [PATCH] Fix for new CALIBRE_FORCE_BUILD_UI_FORMS environment variable causing exception because of a missing import. --- src/calibre/build_forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/build_forms.py b/src/calibre/build_forms.py index 39bf932873..d6e554fc17 100644 --- a/src/calibre/build_forms.py +++ b/src/calibre/build_forms.py @@ -43,9 +43,9 @@ def build_forms(srcdir, info=None, summary=False, check_for_migration=False): # Ensure that people running from source have all their forms rebuilt for # the qt5 migration force_compile = os.environ.get('CALIBRE_FORCE_BUILD_UI_FORMS', '') in ('1', 'yes', 'true') - if check_for_migration and not force_compile: + if check_for_migration: from calibre.gui2 import gprefs - force_compile = not gprefs.get(f'migrated_forms_to_qt{qt_major}', False) + force_compile |= not gprefs.get(f'migrated_forms_to_qt{qt_major}', False) for form in forms: compiled_form = form_to_compiled_form(form) @@ -67,5 +67,5 @@ def build_forms(srcdir, info=None, summary=False, check_for_migration=False): num += 1 if num: info('Compiled %d forms' % num) - if force_compile: + if check_for_migration and force_compile: gprefs.set(f'migrated_forms_to_qt{qt_major}', True)