diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py index 22c86038b9..b615df18d4 100644 --- a/easybuild/framework/easyblock.py +++ b/easybuild/framework/easyblock.py @@ -3489,10 +3489,7 @@ def _sanity_check_step_extensions(self): """Sanity check on extensions (if any).""" failed_exts = [] - if build_option('skip_extensions'): - self.log.info("Skipping sanity check for extensions since skip-extensions is enabled...") - return - elif not self.ext_instances: + if not self.ext_instances: # class instances for extensions may not be initialized yet here, # for example when using --module-only or --sanity-check-only self.prepare_for_extensions() @@ -3644,7 +3641,10 @@ def xs2str(xs): # also run sanity check for extensions (unless we are an extension ourselves) if not extension: - self._sanity_check_step_extensions() + if build_option('skip_extensions'): + self.log.info("Skipping sanity check for extensions since skip-extensions is enabled...") + else: + self._sanity_check_step_extensions() linked_shared_lib_fails = self.sanity_check_linked_shared_libs() if linked_shared_lib_fails: