name of library root doesn't have to be a valid identifier (PY-3933)

This commit is contained in:
Dmitry Jemerov
2011-06-24 19:05:29 +02:00
parent 8be451defd
commit 975569cd3b
@@ -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