From 54a6af86bdcb389293b8f8ac9e37a1aa378b3d84 Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <whit@temple.edu>
Date: Sun, 5 Feb 2017 22:32:02 -0600
Subject: [PATCH] Fixed small bug in TSystem::Load call

TSystem::Load return > 0 if the library is already loaded. This is not an error. For some reason it was already loaded when I run ddsim in a singularity container. I have no idea why.
---
 DDG4/python/DD4hep.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DDG4/python/DD4hep.py b/DDG4/python/DD4hep.py
index 94b0e98e7..e869fe74c 100644
--- a/DDG4/python/DD4hep.py
+++ b/DDG4/python/DD4hep.py
@@ -46,7 +46,7 @@ def loadDD4hep():
     gSystem.SetDynamicPath(os.environ['DD4HEP_LIBRARY_PATH'])
 
   result = gSystem.Load("libDDCore")
-  if 0 != result:
+  if result < 0:
     raise Exception('DD4hep.py: Failed to load the DD4hep library libDDCore: '+gSystem.GetErrorStr())
   from ROOT import DD4hep as module
   return module
-- 
GitLab