Skip to content

Commit 9854bc6

Browse files
committed
Treat ignored files as non-project in autoimport
Fixes test introduced in previous commit.
1 parent b66c699 commit 9854bc6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rope/contrib/autoimport/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ def get_package_source(
4949
"""Detect the source of a given package. Rudimentary implementation."""
5050
if name in sys.builtin_module_names:
5151
return Source.BUILTIN
52-
if project is not None and project.address in str(package):
52+
if (
53+
project is not None
54+
and project.address in str(package)
55+
and not project.is_ignored(project.get_file(str(package)))
56+
):
5357
return Source.PROJECT
5458
if "site-packages" in package.parts:
5559
return Source.SITE_PACKAGE

0 commit comments

Comments
 (0)