Skip to content

Commit

Permalink
Swap to using isinstance of mixins per review.
Browse files Browse the repository at this point in the history
Co-authored-by: Patrick Lehmann <[email protected]>
  • Loading branch information
Tcenova and Paebbels authored Jul 29, 2024
1 parent 3889113 commit 5cbcc96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyVHDLModel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,11 +1016,13 @@ def _ImportObjects(package: Package) -> None:
for referencedLibrary in package._referencedPackages.values():
for referencedPackage in referencedLibrary.values():
for declaredItem in referencedPackage._declaredItems:
if hasattr(declaredItem, "_normalizedIdentifiers"):
if isinstance(declaredItem, MultipleNamedEntityMixin):
for normalizedIdentifier in declaredItem._normalizedIdentifiers:
package._namespace._elements[normalizedIdentifier] = declaredItem
else:
elif isinstance(declaredItem, NamedEntityMixin):
package._namespace._elements[declaredItem._normalizedIdentifier] = declaredItem
else:
raise VHDLModelException(f"Unexpected declared item.")

for libraryName in ("std", "ieee"):
for package in self.GetLibrary(libraryName).IterateDesignUnits(filter=DesignUnitKind.Package): # type: Package
Expand Down

0 comments on commit 5cbcc96

Please sign in to comment.