Add checking whether sub namespaces are not empty in core.python.namespaces.PythonPackageNamespace.namespace

This commit is contained in:
2026-04-07 22:57:18 +02:00
parent fa75b6f036
commit 6cb5d25f5c
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -10,3 +10,4 @@
- Add python project documentation generator class - Add python project documentation generator class
- Add python namespaces classes - Add python namespaces classes
- Add type checking for the `name` attribute at the constructor of `core.python.namespaces.PythonNamespace` - Add type checking for the `name` attribute at the constructor of `core.python.namespaces.PythonNamespace`
- Add check whether sub namespaces are not empty in `core.python.namespaces.PythonPackageNamespace.namespace`
@@ -57,6 +57,10 @@ class PythonPackageNamespace(PythonNamespace):
if not sub_namespaces: if not sub_namespaces:
raise InvalidNamespaceError('invalid namespace') raise InvalidNamespaceError('invalid namespace')
for sn in sub_namespaces:
if not sn:
raise InvalidNamespaceError('invalid namespace')
# check whether the sub namespace exists # check whether the sub namespace exists
if sub_namespaces[0] not in self.sub_namespaces: if sub_namespaces[0] not in self.sub_namespaces:
raise NamespaceNotFoundError('no such namespace', namespace_identifier = sub_namespaces[0]) raise NamespaceNotFoundError('no such namespace', namespace_identifier = sub_namespaces[0])