Skip to content
Snippets Groups Projects
Commit 86262c09 authored by Walter Lampl's avatar Walter Lampl
Browse files

Revert "AthenaPython/Bindings.py: Introduce typed nullptr to deal with return...

Revert "AthenaPython/Bindings.py: Introduce typed nullptr to deal with return values in case of failures"

This reverts commit c6375548.
parent cf374d47
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,6 @@ def _import_ROOT():
import ROOT
ROOT.gROOT.SetBatch(True)
return ROOT
### data ----------------------------------------------------------------------
......@@ -53,14 +52,6 @@ _clid_typename_aliases = {
'Trk::SegmentCollection' : 'DataVector<Trk::Segment>',
}
#Typed nullpointers:
_import_ROOT()
import cppyy
svcNull=cppyy.bind_object(cppyy.nullptr,cppyy.gbl.IService)
toolNull=cppyy.bind_object(cppyy.nullptr,cppyy.gbl.IAlgTool)
algNull=cppyy.bind_object(cppyy.nullptr,cppyy.gbl.IAlgorithm)
### ---------------------------------------------------------------------------
class _PyAthenaBindingsCatalog(object):
......@@ -144,12 +135,9 @@ def py_svc(svcName, createIf=True, iface=None):
if svcName in PyComponents.instances:
svc = PyComponents.instances[svcName]
#Error handling: Convert c++ ptr to python-None
if svc == svcNull:
return None
from AthenaPython import PyAthena
setattr(PyAthena.services, svcName, svc)
if svc:
from AthenaPython import PyAthena
setattr(PyAthena.services, svcName, svc)
return svc
### helper method to easily retrieve tools from ToolSvc by name ---------------
......@@ -199,12 +187,9 @@ def py_tool(toolName, createIf=True, iface=None):
if toolName in PyComponents.instances:
tool = PyComponents.instances[toolName]
#Error handling: Convert c++ ptr to python-None
if tool == toolNull:
return None
from AthenaPython import PyAthena
setattr(PyAthena.services.ToolSvc, toolName, tool)
if tool:
from AthenaPython import PyAthena
setattr(PyAthena.services.ToolSvc, toolName, tool)
return tool
### helper method to easily retrieve algorithms by name -----------------------
......@@ -247,12 +232,9 @@ def py_alg(algName, iface='IAlgorithm'):
if algName in PyComponents.instances:
alg = PyComponents.instances[algName]
if alg==algNull:
return None
from AthenaPython import PyAthena
setattr(PyAthena.algs, algName, alg)
if alg:
from AthenaPython import PyAthena
setattr(PyAthena.algs, algName, alg)
return alg
### pythonizations for StoreGateSvc
......@@ -855,7 +837,6 @@ def _setup():
_register('DataLink', _py_init_DataLink)
_register('ElementLink', _py_init_ElementLink)
_register('ElementLinkVector', _py_init_ElementLinkVector)
pass
## execute method at module import
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment