Skip to content

Commit 1f9de1c

Browse files
committed
Workaround macro lookup failure with gInterpreter -> gCling in Python
1 parent 0eb7287 commit 1f9de1c

File tree

20 files changed

+51
-51
lines changed

20 files changed

+51
-51
lines changed

bindings/distrdf/python/DistRDF/Backends/Base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def setup_mapper(initialization_fn: Callable, code_to_declare: str) -> None:
4949
initialization_fn()
5050

5151
# Declare all user code in one call
52-
ROOT.gInterpreter.Declare(code_to_declare)
52+
ROOT.gCling.Declare(code_to_declare)
5353

5454

5555
def get_mergeable_values(starting_node: ROOT.RDF.RNode, range_id: int,
@@ -215,7 +215,7 @@ def register_declaration(cls, code_to_declare):
215215
code_with_guard = f"#ifndef {hex}\n#define {hex}\n{stripped}\n#endif"
216216
cls.strings_to_declare[hex] = code_with_guard
217217

218-
ROOT.gInterpreter.Declare(cls.strings_to_declare[hex])
218+
ROOT.gCling.Declare(cls.strings_to_declare[hex])
219219

220220
@classmethod
221221
def register_shared_lib(cls, paths_to_shared_libraries):

bindings/distrdf/python/DistRDF/Backends/Utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ def extend_include_path(include_path: str) -> None:
3939
needed for the analysis.
4040
"""
4141
root_path = "-I{}".format(include_path)
42-
ROOT.gInterpreter.AddIncludePath(root_path)
42+
ROOT.gCling.AddIncludePath(root_path)
4343

4444
# Retrieve ROOT internal list of include paths and add debug statement
45-
root_includepath = ROOT.gInterpreter.GetIncludePath()
45+
root_includepath = ROOT.gCling.GetIncludePath()
4646
logger.debug("ROOT include paths:\n{}".format(root_includepath))
4747

4848

@@ -62,7 +62,7 @@ def distribute_headers(headers_to_include: Iterable[str]) -> None:
6262
# Create C++ include code
6363
include_code = "#include \"{}\"\n".format(header)
6464
try:
65-
ROOT.gInterpreter.Declare(include_code)
65+
ROOT.gCling.Declare(include_code)
6666
except Exception as e:
6767
msg = "There was an error in including \"{}\" !".format(header)
6868
raise e(msg)

bindings/distrdf/test/backend/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_initialization_runs_in_current_environment(self):
7070
"""
7171
def defineIntVariable(name, value):
7272
import ROOT
73-
ROOT.gInterpreter.ProcessLine("int %s = %s;" % (name, value))
73+
ROOT.gCling.ProcessLine("int %s = %s;" % (name, value))
7474

7575
varvalue = 2
7676
DistRDF.initialize(defineIntVariable, "myInt", varvalue)

bindings/pyroot/cppyy/cppyy/python/cppyy/__pyinstaller/hook-cppyy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def datafile(path):
2121
def _api_files():
2222
import cppyy, os
2323

24-
paths = str(cppyy.gbl.gInterpreter.GetIncludePath()).split('-I')
24+
paths = str(cppyy.gbl.gCling.GetIncludePath()).split('-I')
2525
for p in paths:
2626
if not p: continue
2727

bindings/pyroot/cppyy/cppyy/test/assert_interactive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
assert g.std
1515
except ImportError:
1616
# full lazy lookup available
17-
assert gInterpreter
17+
assert gCling

bindings/pyroot/cppyy/cppyy/test/test_crossinheritance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ def test27_interfaces(self):
12001200

12011201
import cppyy
12021202

1203-
cppyy.gbl.gInterpreter.Declare("""\
1203+
cppyy.gbl.gCling.Declare("""\
12041204
namespace NonStandardOffset {
12051205
struct Calc1 {
12061206
virtual int calc1() = 0;

bindings/pyroot/cppyy/cppyy/test/test_datatypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setup_class(cls):
1414
cls.datatypes = cppyy.load_reflection_info(cls.test_dct)
1515
cls.N = cppyy.gbl.N
1616

17-
at_least_17 = 201402 < cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;")
17+
at_least_17 = 201402 < cppyy.gbl.gCling.ProcessLine("__cplusplus;")
1818
cls.has_byte = at_least_17
1919
cls.has_optional = at_least_17
2020

bindings/pyroot/cppyy/cppyy/test/test_fragile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ def test01_abortive_signals(self):
789789
class TestSTDNOTINGLOBAL:
790790
def setup_class(cls):
791791
import cppyy
792-
cls.has_byte = 201402 < cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;")
792+
cls.has_byte = 201402 < cppyy.gbl.gCling.ProcessLine("__cplusplus;")
793793

794794
@mark.xfail()
795795
def test01_stl_in_std(self):

bindings/pyroot/cppyy/cppyy/test/test_lowlevel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setup_class(cls):
1515
cls.datatypes = cppyy.load_reflection_info(cls.test_dct)
1616
cls.N = cppyy.gbl.N
1717

18-
at_least_17 = 201402 < cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;")
18+
at_least_17 = 201402 < cppyy.gbl.gCling.ProcessLine("__cplusplus;")
1919
cls.has_nested_namespace = at_least_17
2020

2121
def test00_import_all(self):

bindings/pyroot/cppyy/cppyy/test/test_regression.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ def test02_dir(self):
5656

5757
import cppyy, pydoc
5858

59-
assert not '__abstractmethods__' in dir(cppyy.gbl.gInterpreter)
60-
assert '__class__' in dir(cppyy.gbl.gInterpreter)
59+
assert not '__abstractmethods__' in dir(cppyy.gbl.gCling)
60+
assert '__class__' in dir(cppyy.gbl.gCling)
6161

6262
self.__class__.helpout = []
63-
pydoc.doc(cppyy.gbl.gInterpreter)
63+
pydoc.doc(cppyy.gbl.gCling)
6464
helptext = ''.join(self.__class__.helpout)
6565
assert 'TInterpreter' in helptext
6666
assert 'CPPInstance' in helptext
@@ -1020,7 +1020,7 @@ def test35_filesytem(self):
10201020

10211021
import cppyy
10221022

1023-
if cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;") > 201402:
1023+
if cppyy.gbl.gCling.ProcessLine("__cplusplus;") > 201402:
10241024
cppyy.cppdef("""\
10251025
#include <filesystem>
10261026
std::string stack_std_path() {

0 commit comments

Comments
 (0)