Skip to content

[Python] Don't call TClass::GetClass() on branch type in TTreePyz #18604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions bindings/pyroot/pythonizations/src/TTreePyz.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,12 @@ static std::pair<void *, std::string> ResolveBranch(TTree *tree, const char *nam

// for return of a full object
if (branch->IsA() == TBranchElement::Class() || branch->IsA() == TBranchObject::Class()) {
TClass *klass = TClass::GetClass(branch->GetClassName());
if (klass && branch->GetAddress())
if (branch->GetAddress())
return {*(void **)branch->GetAddress(), branch->GetClassName()};

// try leaf, otherwise indicate failure by returning a typed null-object
TObjArray *leaves = branch->GetListOfLeaves();
if (klass && !tree->GetLeaf(name) && !(leaves->GetSize() && (leaves->First() == leaves->Last())))
if (!tree->GetLeaf(name) && !(leaves->GetSize() && (leaves->First() == leaves->Last())))
return {nullptr, branch->GetClassName()};
}

Expand Down
Loading