Skip to content

Commit

Permalink
Make it an import error if the header cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 19, 2024
1 parent 81934c3 commit b458e49
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions python/podio/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
import ROOT

# NOTE: It is necessary that this can be found on the ROOT_INCLUDE_PATH
#
# We check whether we can actually load the header to not break python bindings
# in environments with *ancient* podio versions
if ROOT.gInterpreter.LoadFile("podio/podioVersion.h") == 0: # noqa: E402
from ROOT import podio # noqa: E402 # pylint: disable=wrong-import-position
if ROOT.gInterpreter.LoadFile("podio/podioVersion.h") != 0: # noqa: E402
raise ImportError("Cannot find the podio/podioVersion.h header")

from ROOT import podio # noqa: E402 # pylint: disable=wrong-import-position

Version = podio.version.Version

Expand Down

0 comments on commit b458e49

Please sign in to comment.