Skip to content

Commit

Permalink
Instance version == 0 might differ from streamer version. Don't compi…
Browse files Browse the repository at this point in the history
…le a new class in that case. (#537)
  • Loading branch information
jpivarski committed Jan 14, 2022
1 parent c19464e commit 885ecb2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/uproot/model.py
Expand Up @@ -1172,7 +1172,10 @@ def class_of_version(cls, version):
If not, this classmethod returns None. No attempt is made to create a
missing class.
"""
return cls.known_versions.get(version)
out = cls.known_versions.get(version)
if out is None and version == 0 and len(cls.known_versions) != 0:
out = cls.known_versions[max(cls.known_versions)]
return out

@classmethod
def has_version(cls, version):
Expand Down Expand Up @@ -1267,7 +1270,7 @@ def read(cls, chunk, cursor, context, file, selffile, parent, concrete=None):
is_memberwise,
) = uproot.deserialization.numbytes_version(chunk, cursor, context, move=False)

versioned_cls = cls.known_versions.get(version)
versioned_cls = cls.class_of_version(version)

if versioned_cls is not None:
pass
Expand Down

0 comments on commit 885ecb2

Please sign in to comment.