diff --git a/CHANGELOG.md b/CHANGELOG.md index d8f3064d4..fedcd1f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,11 @@ - - +## HDMF 2.5.7 (June 4, 2021) + +### Bug fix +- Fix generation of extension classes that extend MultiContainerInterface and use a custom _fieldsname. @rly (#626) + ## HDMF 2.5.6 (May 19, 2021) ### Bug fix diff --git a/src/hdmf/build/__init__.py b/src/hdmf/build/__init__.py index 5f467d916..ea5d21152 100644 --- a/src/hdmf/build/__init__.py +++ b/src/hdmf/build/__init__.py @@ -1,5 +1,5 @@ from .builders import Builder, DatasetBuilder, GroupBuilder, LinkBuilder, ReferenceBuilder, RegionBuilder -from .classgenerator import CustomClassGenerator +from .classgenerator import CustomClassGenerator, MCIClassGenerator from .errors import (BuildError, OrphanContainerBuildError, ReferenceTargetNotBuiltError, ContainerConfigurationError, ConstructError) from .manager import BuildManager, TypeMap diff --git a/src/hdmf/build/classgenerator.py b/src/hdmf/build/classgenerator.py index edd95a6e7..db4f326d3 100644 --- a/src/hdmf/build/classgenerator.py +++ b/src/hdmf/build/classgenerator.py @@ -268,9 +268,10 @@ def post_process(cls, classdict, bases, docval_args, spec): :param spec: The spec for the container class to generate. """ # convert classdict['__fields__'] from list to tuple if present - fields = classdict.get(bases[0]._fieldsname) - if fields is not None: - classdict[bases[0]._fieldsname] = tuple(fields) + for b in bases: + fields = classdict.get(b._fieldsname) + if fields is not None and not isinstance(fields, tuple): + classdict[b._fieldsname] = tuple(fields) # if spec provides a fixed name for this type, remove the 'name' arg from docval_args so that values cannot # be passed for a name positional or keyword arg