diff --git a/python/podio/__init__.py b/python/podio/__init__.py index db02e7cee..4b6e3df0f 100644 --- a/python/podio/__init__.py +++ b/python/podio/__init__.py @@ -15,18 +15,18 @@ # Check if we can locate the dictionary wthout loading it as this allows us to # silence any ouptput. If we can find it, we can also safely load it if ROOT.gSystem.DynamicPathName("libpodioDict.so", True): - ROOT.gSystem.Load("libpodioDict.so") - from ROOT import podio + ROOT.gSystem.Load("libpodioDict.so") + from ROOT import podio - _DYNAMIC_LIBS_LOADED = True + _DYNAMIC_LIBS_LOADED = True if _DYNAMIC_LIBS_LOADED: - from .frame import Frame - from . import root_io, sio_io, reading - from .test_utils import * + from .frame import Frame + from . import root_io, sio_io, reading + from .test_utils import * - from . import EventStore + from . import EventStore - # Make sure that this module is actually usable as podio even though most of - # it is dynamically populated by cppyy - sys.modules["podio"] = podio + # Make sure that this module is actually usable as podio even though most of + # it is dynamically populated by cppyy + sys.modules["podio"] = podio diff --git a/python/podio/test_utils.py b/python/podio/test_utils.py index 8a2679c83..efd2d53f4 100644 --- a/python/podio/test_utils.py +++ b/python/podio/test_utils.py @@ -3,8 +3,9 @@ import os import ROOT -ROOT.gSystem.Load("libTestDataModelDict.so") # noqa: E402 -from ROOT import ExampleHitCollection, ExampleClusterCollection # noqa: E402 # pylint: disable=wrong-import-position + +if ROOT.gSystem.Load("libTestDataModelDict.so") >= 0: # noqa: E402 + from ROOT import ExampleHitCollection, ExampleClusterCollection # noqa: E402 # pylint: disable=wrong-import-position from podio import Frame # pylint: disable=wrong-import-position