Skip to content
Open
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
13 changes: 4 additions & 9 deletions pyEDAA/ProjectModel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

from os.path import relpath as path_relpath
from pathlib import Path as pathlib_Path
from sys import version_info
from typing import Dict, Union, Optional as Nullable, List, Iterable, Generator, Tuple, Any as typing_Any, Type, Set, Self

from pyTooling.Common import getFullyQualifiedName
Expand Down Expand Up @@ -442,8 +441,7 @@ def __init__(self, path: pathlib_Path, vhdlLibrary: Union[str, 'VHDLLibrary'] =
self._vhdlLibrary = None
else:
ex = TypeError(f"Parameter 'vhdlLibrary' is neither a 'str' nor 'VHDLibrary'.")
if version_info >= (3, 11): # pragma: no cover
ex.add_note(f"Got type '{getFullyQualifiedName(vhdlLibrary)}'.")
ex.add_note(f"Got type '{getFullyQualifiedName(vhdlLibrary)}'.")
raise ex

self._vhdlVersion = vhdlVersion
Expand Down Expand Up @@ -919,13 +917,11 @@ def AddFile(self, file: File) -> None:
raise TypeError("Parameter 'file' is not of type ProjectModel.File.")
elif file._fileSet is not None:
ex = ValueError(f"File '{file.Path!s}' is already part of fileset '{file.FileSet.Name}'.")
if version_info >= (3, 11): # pragma: no cover
ex.add_note(f"A file can't be assigned to another fileset.")
ex.add_note(f"A file can't be assigned to another fileset.")
raise ex
elif file in self._set:
ex = ValueError(f"File '{file.Path!s}' is already part of this fileset.")
if version_info >= (3, 11): # pragma: no cover
ex.add_note(f"A file can't be added twice to a fileset.")
ex.add_note(f"A file can't be added twice to a fileset.")
raise ex

self._files.append(file)
Expand Down Expand Up @@ -1259,8 +1255,7 @@ def AddDependency(self, library: 'VHDLLibrary') -> None:
def AddFile(self, vhdlFile: VHDLSourceFile) -> None:
if not isinstance(vhdlFile, VHDLSourceFile):
ex = TypeError(f"Parameter 'vhdlFile' is not a 'VHDLSourceFile'.")
if version_info >= (3, 11): # pragma: no cover
ex.add_note(f"Got type '{getFullyQualifiedName(vhdlFile)}'.")
ex.add_note(f"Got type '{getFullyQualifiedName(vhdlFile)}'.")
raise ex

self._files.append(vhdlFile)
Expand Down
Loading