root/root-Python-Update-reference-refcount-values-for-Python-3x.patch
Mattias Ellert 0afdff9fae Add root-tree-ntuple and root-tree-ntuple-utils dependensies to root-core
(listed in root-config --libs)
Rename root-fonts package to root-font-files
Add optional test dependency python3-pandas now available in EPEL 10
Add dependency jupyter-notebook to root-jupyroot for EPEL 10.1 and later
Fix Python 3.14 refcount issues in tests
2025-06-21 05:38:04 +02:00

44 lines
1.9 KiB
Diff

From 530d925f9832fe5fd1469ebf145f85227cfce1d4 Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Fri, 20 Jun 2025 07:21:05 +0200
Subject: [PATCH] [Python] Update reference refcount values for Python 3.14
compatibility
---
bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py | 2 +-
bindings/pyroot/pythonizations/test/rvec_asrvec.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py b/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py
index c7da723523..fc0f88155a 100644
--- a/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py
+++ b/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py
@@ -90,7 +90,7 @@ class DataFrameFromNumpy(unittest.TestCase):
df = ROOT.RDF.FromNumpy(data)
gc.collect()
- self.assertEqual(sys.getrefcount(df), 2)
+ self.assertEqual(sys.getrefcount(df), 1 + int(sys.version_info < (3, 14)))
self.assertEqual(sys.getrefcount(data["x"]), 3)
diff --git a/bindings/pyroot/pythonizations/test/rvec_asrvec.py b/bindings/pyroot/pythonizations/test/rvec_asrvec.py
index 9d3a294bf1..f489da826e 100644
--- a/bindings/pyroot/pythonizations/test/rvec_asrvec.py
+++ b/bindings/pyroot/pythonizations/test/rvec_asrvec.py
@@ -137,10 +137,10 @@ class AsRVec(unittest.TestCase):
rvec = ROOT.VecOps.AsRVec(np_obj)
gc.collect()
self.assertEqual(sys.getrefcount(rvec), 1 + int(sys.version_info < (3, 14)))
- self.assertEqual(sys.getrefcount(np_obj), 3)
+ self.assertEqual(sys.getrefcount(np_obj), 2 + int(sys.version_info < (3, 14)))
del rvec
gc.collect()
- self.assertEqual(sys.getrefcount(np_obj), 2)
+ self.assertEqual(sys.getrefcount(np_obj), 1 + int(sys.version_info < (3, 14)))
if __name__ == "__main__":
--
2.49.0