Skip to content

Commit eb41648

Browse files
committed
Fix TypeError in DQMServices/Demo/test/dqmiodumpentries.py. Omit DeprecationWarning of getattr().
| ROOT version | `getattr(f,"x")` | `f["x"]` | | ------------ | ---------------- | ----------- | | v6.30 | works | Not working | | v6.35 | works* | works | | v6.32 | works* | works | * This will display deprecation warning message
1 parent cca126b commit eb41648

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DQMServices/Demo/test/dqmiodumpentries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131

3232
f = ROOT.TFile.Open(args.inputfile)
33-
idxtree = f["Indices"]
33+
idxtree = getattr(f, "Indices")
3434

3535
summary = defaultdict(lambda: 0)
3636

@@ -42,7 +42,7 @@
4242

4343
# inclusive range -- for 0 entries, row is left out
4444
firstidx, lastidx = idxtree.FirstIndex, idxtree.LastIndex
45-
metree = f[treenames[metype]]
45+
metree = getattr(f, treenames[metype])
4646
# this GetEntry is only to make sure the TTree is initialized correctly
4747
metree.GetEntry(0)
4848
metree.SetBranchStatus("*",0)

0 commit comments

Comments
 (0)