From 43d1ee123ff63266c5804fe4ebebac666ad62404 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 14 Jul 2016 12:06:53 +0000
Subject: [PATCH] DDG4 Python: Do not print errors when loading libglapi fails

---
 DDG4/python/DDG4.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/DDG4/python/DDG4.py b/DDG4/python/DDG4.py
index 436f23a29..eabb0108b 100644
--- a/DDG4/python/DDG4.py
+++ b/DDG4/python/DDG4.py
@@ -13,8 +13,16 @@
 from DD4hep import *
 
 def loadDDG4():
+  ## import ROOT ## done in import * above
   from ROOT import gSystem
-  result = gSystem.Load("libglapi")
+
+  ## Try to load libglapi to avoid issues with TLS Static
+  ## Turn off all errors from ROOT about the library missing
+  orgLevel = ROOT.gErrorIgnoreLevel
+  ROOT.gErrorIgnoreLevel=6000
+  gSystem.Load("libglapi")
+  ROOT.gErrorIgnoreLevel=orgLevel
+
   result = gSystem.Load("libDDG4Plugins")
   if 0 != result:
     raise Exception('DDG4.py: Failed to load the Geant4 library libDDG4: '+gSystem.GetErrorStr())
-- 
GitLab