diff --git a/Examples/Python/tests/helpers/__init__.py b/Examples/Python/tests/helpers/__init__.py index 834378df75d..9ac9dc3d2c0 100644 --- a/Examples/Python/tests/helpers/__init__.py +++ b/Examples/Python/tests/helpers/__init__.py @@ -27,19 +27,18 @@ ) dd4hepEnabled = "DD4hep_DIR" in os.environ - if dd4hepEnabled: try: import acts.examples.dd4hep except ImportError: dd4hepEnabled = False -try: - import acts.examples.hepmc3 - - hepmc3Enabled = True -except ImportError: - hepmc3Enabled = False +hepmc3Enabled = "HepMC3_DIR" in os.environ +if hepmc3Enabled: + try: + import acts.examples.hepmc3 + except: + hepmc3Enabled = False isCI = os.environ.get("CI", "false") == "true"