From ddbe5a9eb839953dc5ce396952556506cc600bcc Mon Sep 17 00:00:00 2001
From: David Blyth <dblyth@anl.gov>
Date: Mon, 30 Oct 2017 20:28:08 +0000
Subject: [PATCH] DDG4/python/DDG4.py: Changed failure condition for loadDDG4()

Since gSystem.load() can return 1 if the library has already been
loaded, there are cases where requiring `result == 0` raises a false
exception.  This commit changes the required condition to be `result >=
0`
---
 DDG4/python/DDG4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DDG4/python/DDG4.py b/DDG4/python/DDG4.py
index 34dd78f61..e19fa0787 100644
--- a/DDG4/python/DDG4.py
+++ b/DDG4/python/DDG4.py
@@ -28,7 +28,7 @@ def loadDDG4():
     gSystem.SetDynamicPath(os.environ['DD4HEP_LIBRARY_PATH'])
 
   result = gSystem.Load("libDDG4Plugins")
-  if 0 != result:
+  if result < 0:
     raise Exception('DDG4.py: Failed to load the DDG4 library libDDG4Plugins: '+gSystem.GetErrorStr())
   from ROOT import dd4hep as module
   return module
-- 
GitLab