vyper Version (output of vyper --version): commit 4b4e188ba83d28b5dd6ff66479e7448e5b925030
Issue description
In ModuleAnalyzer._load_import_helper(), the following check ensures
that a given file is not imported multiple times:
if path in self._imported_modules:
previous_import_stmt = self._imported_modules[path]
raise DuplicateImport(f"{alias} imported more than once!", previous_import_stmt, node)
However, the check is not performed using a normalized path as it is
being done in the input bundle. This means that for a lib1 in the
directory project, it can be bypassed as follows:
import lib1
from ..project import lib1 as lib2
Note however that since paths are normalized in the input bundle, if the
two modules are initialized, for example, the compiler will raise an
exception.
Version Information
vyper --version
): commit 4b4e188ba83d28b5dd6ff66479e7448e5b925030Issue description
In
ModuleAnalyzer._load_import_helper()
, the following check ensures that a given file is not imported multiple times:However, the check is not performed using a normalized path as it is being done in the input bundle. This means that for a
lib1
in the directoryproject
, it can be bypassed as follows:Note however that since paths are normalized in the input bundle, if the two modules are initialized, for example, the compiler will raise an exception.
credits: @trocher