From 975569cd3beed93c3d4425f219e1ef953e652e7b Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 24 Jun 2011 16:39:47 +0200 Subject: [PATCH] name of library root doesn't have to be a valid identifier (PY-3933) --- .../python/codeInsight/imports/PythonReferenceImporter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/codeInsight/imports/PythonReferenceImporter.java b/python/src/com/jetbrains/python/codeInsight/imports/PythonReferenceImporter.java index 72c0ce09a1fa..eeeeb35b3f10 100644 --- a/python/src/com/jetbrains/python/codeInsight/imports/PythonReferenceImporter.java +++ b/python/src/com/jetbrains/python/codeInsight/imports/PythonReferenceImporter.java @@ -113,7 +113,7 @@ public class PythonReferenceImporter implements ReferenceImporter { if (isTopLevel(symbol)) { // we only want top-level symbols PsiFileSystemItem srcfile = symbol instanceof PsiFileSystemItem ? ((PsiFileSystemItem)symbol).getParent() : symbol.getContainingFile(); if (srcfile != null && srcfile != existing_import_file && srcfile != node.getContainingFile() && - PyNames.isIdentifier(FileUtil.getNameWithoutExtension(srcfile.getName()))) { + (ImportFromExistingAction.isRoot(project, srcfile) || PyNames.isIdentifier(FileUtil.getNameWithoutExtension(srcfile.getName())))) { PyQualifiedName import_path = ResolveImportUtil.findCanonicalImportPath(srcfile, node); if (import_path != null && !seen_file_names.contains(import_path.toString())) { // a new, valid hit