Drop patches accepted upstream: root-avoid-gui-crash.patch root-doxygen-generation-with-python-3.patch Drop patches with alternative fix implemented upstream: root-dont-install-eve7-files.patch root-ix32-geom-opt.patch Drop ppc64 specific workaround (ppc64 no longer built in Fedora or EPEL): root-ppc64-doc.patch Dropped subpackages: root-geocad root-graf-qt root-gui-qt root-gui-qtgsi root-io-hdfs root-io-rfio root-net-bonjour root-net-globus root-net-ldap root-net-krb5 root-table Drop BuildRequires needed by the dropped subpackages New subpackages: root-graf3d-csg (split off from root-graf3d-gl) root-gui-browserv7 root-tree-ntuple Don't build python2-root for Fedora >= 31 Include desktop and MIME type files in source RPM (removed from source) Install man pages in correct directory Use correct library names in plugin definitions Don't download test input file if it already exists Python 3 fixes Increase test tolerance (aarch64 and ppc64le) Fix GDB pretty printers install name and location
69 lines
1.9 KiB
Diff
69 lines
1.9 KiB
Diff
From 4cf9170f308934688e7f767086589cd8cc0a0a85 Mon Sep 17 00:00:00 2001
|
|
From: Mattias Ellert <mattias.ellert@physics.uu.se>
|
|
Date: Fri, 28 Jun 2019 22:23:49 +0200
|
|
Subject: [PATCH] Python 3 compatibility
|
|
|
|
---
|
|
tutorials/histfactory/example.py | 2 +-
|
|
tutorials/pyroot/mrt.py | 20 ++++++++++----------
|
|
2 files changed, 11 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/tutorials/histfactory/example.py b/tutorials/histfactory/example.py
|
|
index 91e1d26939..6ccf3bb350 100755
|
|
--- a/tutorials/histfactory/example.py
|
|
+++ b/tutorials/histfactory/example.py
|
|
@@ -12,7 +12,7 @@ def main():
|
|
try:
|
|
import ROOT
|
|
except:
|
|
- print "It seems that pyROOT isn't properly configured"
|
|
+ print("It seems that pyROOT isn't properly configured")
|
|
return
|
|
|
|
"""
|
|
diff --git a/tutorials/pyroot/mrt.py b/tutorials/pyroot/mrt.py
|
|
index b3a8c0d719..17a73f6881 100644
|
|
--- a/tutorials/pyroot/mrt.py
|
|
+++ b/tutorials/pyroot/mrt.py
|
|
@@ -10,28 +10,28 @@
|
|
##
|
|
## \author Wim Lavrijsen
|
|
|
|
-import sys, string, os
|
|
-from ROOT import TFile, TNtuple
|
|
+import sys, os
|
|
+from ROOT import TFile, TNtuple, TROOT
|
|
|
|
|
|
-ifn = os.path.expandvars("${ROOTSYS}/tutorials/pyroot/aptuple.txt")
|
|
+ifn = os.path.join(str(TROOT.GetTutorialDir()), 'pyroot', 'aptuple.txt')
|
|
ofn = 'aptuple.root'
|
|
|
|
-print 'opening file', ifn, '...'
|
|
+print('opening file %s ...' % ifn)
|
|
infile = open( ifn, 'r' )
|
|
lines = infile.readlines()
|
|
title = lines[0]
|
|
-labels = string.split( lines[1] )
|
|
+labels = lines[1].split()
|
|
|
|
-print 'writing file', ofn, '...'
|
|
+print('writing file %s ...' % ofn)
|
|
outfile = TFile( ofn, 'RECREATE', 'ROOT file with an NTuple' )
|
|
-ntuple = TNtuple( 'ntuple', title, string.join( labels, ':') )
|
|
+ntuple = TNtuple( 'ntuple', title, ':'.join( labels ) )
|
|
|
|
for line in lines[2:]:
|
|
- words = string.split( line )
|
|
+ words = line.split()
|
|
row = map( float, words )
|
|
- apply( ntuple.Fill, row )
|
|
+ ntuple.Fill(*row)
|
|
|
|
outfile.Write()
|
|
|
|
-print 'done'
|
|
+print('done')
|
|
--
|
|
2.21.0
|
|
|