Skip to content

Modules can be imported more than once #4770

@Sporarum

Description

@Sporarum

Version Information

  • vyper Version (output of vyper --version): a68eb57
  • OS: linux
  • Python Version (output of python --version): 3.12.11

What's your issue about?

# playground/test.vy
from . import x as x1
from ..playground import x as x2
# playground/x.vy

# empty file

vyper playground/test.vy compiles without issue

How can it be fixed?

It should raise a vyper.exceptions.DuplicateImport, like:

# playground/test.vy
from . import x as x1
from . import x as x2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions