Skip to content

Fix import errors when loading multiple matchers (fixes #60)#62

Open
gmberton wants to merge 1 commit intomainfrom
fix/issue-60-import-collisions
Open

Fix import errors when loading multiple matchers (fixes #60)#62
gmberton wants to merge 1 commit intomainfrom
fix/issue-60-import-collisions

Conversation

@gmberton
Copy link
Copy Markdown
Owner

@gmberton gmberton commented Apr 9, 2026

Multiple third-party repos share generic package names like src. Python caches the first import in sys.modules, so loading a second matcher silently gets the wrong module.

add_to_path() now scans the added directory for packages that are already cached from a different third-party directory, and flushes the stale entries. User code and pip packages are never affected.

Fixes #60

Multiple third-party repos share generic package names like `src`.
Python caches the first import in `sys.modules`, so loading a second
matcher silently gets the wrong module.

`add_to_path()` now scans the added directory for packages that are
already cached from a different third-party directory, and flushes the
stale entries. User code and pip packages are never affected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors during import matchers

1 participant