You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vyper Version (output of vyper --version): commit 4b4e188
Issue description
In ModuleAnalyzer._load_import_helper(), the following check ensures
that a given file is not imported multiple times:
ifpathinself._imported_modules:
previous_import_stmt=self._imported_modules[path]
raiseDuplicateImport(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:
importlib1from ..projectimportlib1aslib2
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 4b4e188Issue description
In
ModuleAnalyzer._load_import_helper()
, the following check ensuresthat 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 thedirectory
project
, 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
The text was updated successfully, but these errors were encountered: