From 98dfa241ae8af3b16ab9d292aed508f348db7999 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 1 Nov 2010 15:13:14 +0300 Subject: [PATCH] don't auto-import from current file (PY-2212) --- .../jetbrains/python/validation/PythonReferenceImporter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/validation/PythonReferenceImporter.java b/python/src/com/jetbrains/python/validation/PythonReferenceImporter.java index ab40da149ef9..428141953dbd 100644 --- a/python/src/com/jetbrains/python/validation/PythonReferenceImporter.java +++ b/python/src/com/jetbrains/python/validation/PythonReferenceImporter.java @@ -110,7 +110,7 @@ public class PythonReferenceImporter implements ReferenceImporter { for (PsiElement symbol : symbols) { if (isTopLevel(symbol)) { // we only want top-level symbols PsiFile srcfile = symbol.getContainingFile(); - if (srcfile != null && srcfile != existing_import_file) { + if (srcfile != null && srcfile != existing_import_file && srcfile != node.getContainingFile()) { VirtualFile vfile = srcfile.getVirtualFile(); if (vfile != null) { String import_path = ResolveImportUtil.findShortestImportableName(node, vfile);