Skip to content

Commit 30c8fe7

Browse files
committed
pythonization(tcolor): remove wrapper docstring to clarify functools.wraps behavior (review)
1 parent c72f0e0 commit 30c8fe7

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_tcolor.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,8 @@
1414

1515

1616
def _tcolor_constructor(original_init):
17-
"""
18-
Wrapper for TColor constructor that retains ownership to avoid double deletes.
19-
Uses functools.wraps to preserve the original function's attributes.
20-
"""
2117
@functools.wraps(original_init)
2218
def wrapper(self, *args, **kwargs):
23-
"""
24-
Forward the arguments to the C++ constructor and retain ownership. This
25-
helps avoiding double deletes due to ROOT automatic memory management.
26-
"""
2719
original_init(self, *args, **kwargs)
2820
import ROOT
2921
ROOT.SetOwnership(self, False)

roottest/python/JupyROOT/verify_fix.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ def verify_fix():
1515
print("=" * 70)
1616
print()
1717

18-
# Path to the fixed file
19-
tcolor_file = "/Volumes/Backup Plus/root/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_tcolor.py"
18+
# Path to the fixed file - relative to script location
19+
script_dir = os.path.dirname(os.path.abspath(__file__))
20+
repo_root = os.path.abspath(os.path.join(script_dir, '..', '..', '..'))
21+
tcolor_file = os.path.join(repo_root, "bindings", "pyroot", "pythonizations",
22+
"python", "ROOT", "_pythonization", "_tcolor.py")
2023

2124
if not os.path.exists(tcolor_file):
2225
print("ERROR: Cannot find _tcolor.py file")
@@ -108,12 +111,15 @@ def verify_tests():
108111
print("=" * 70)
109112
print()
110113

114+
script_dir = os.path.dirname(os.path.abspath(__file__))
115+
repo_root = os.path.abspath(os.path.join(script_dir, '..', '..', '..'))
116+
jupyroot_dir = os.path.join(repo_root, "roottest", "python", "JupyROOT")
111117
test_files = {
112-
"Jupyter Notebook Test": "/Volumes/Backup Plus/root/roottest/python/JupyROOT/tcolor_definedcolors.ipynb",
113-
"Python Unit Test": "/Volumes/Backup Plus/root/roottest/python/JupyROOT/test_tcolor_metadata.py",
114-
"CMakeLists.txt": "/Volumes/Backup Plus/root/roottest/python/JupyROOT/CMakeLists.txt",
115-
"Fix Summary": "/Volumes/Backup Plus/root/roottest/python/JupyROOT/ISSUE_20018_FIX_SUMMARY.md",
116-
"Test README": "/Volumes/Backup Plus/root/roottest/python/JupyROOT/README_TCOLOR_TEST.md"
118+
"Jupyter Notebook Test": os.path.join(jupyroot_dir, "tcolor_definedcolors.ipynb"),
119+
"Python Unit Test": os.path.join(jupyroot_dir, "test_tcolor_metadata.py"),
120+
"CMakeLists.txt": os.path.join(jupyroot_dir, "CMakeLists.txt"),
121+
"Fix Summary": os.path.join(jupyroot_dir, "ISSUE_20018_FIX_SUMMARY.md"),
122+
"Test README": os.path.join(jupyroot_dir, "README_TCOLOR_TEST.md")
117123
}
118124

119125
all_exist = True

0 commit comments

Comments
 (0)