PY-58464 Restore stdlib canonical path for Decimal

GitOrigin-RevId: 1c0df1d9c9e8ad22b464e54c4bc30dda4f903946
This commit is contained in:
Andrey.Matveev
2023-08-25 09:24:54 +03:00
committed by intellij-monorepo-bot
parent 85aea1e221
commit f38d61eed6
4 changed files with 10 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ fun restoreStdlibCanonicalPath(qName: QualifiedName): QualifiedName? {
"ntpath", "posixpath", "path", "macpath", "os2emxpath", "genericpath" -> qName.replaceHead("os.path")
"_sqlite3" -> qName.replaceHead("sqlite3")
"_pickle" -> qName.replaceHead("pickle")
"_decimal" -> qName.replaceHead("decimal")
else -> null
}
}

View File

@@ -0,0 +1 @@
<error descr="Unresolved reference 'Decimal'">Dec<caret>imal</error>

View File

@@ -0,0 +1,3 @@
from decimal import Decimal
Decimal

View File

@@ -464,6 +464,11 @@ public class PyAddImportQuickFixTest extends PyQuickFixTestCase {
);
}
// PY-58464
public void testDecimalCanonicalPath() {
doMultiFileAutoImportTest("Import 'decimal.Decimal'");
}
private void doTestProposedImportsOrdering(String @NotNull ... expected) {
doMultiFileAutoImportTest("Import", fix -> {
final List<String> candidates = ContainerUtil.map(fix.getCandidates(), c -> c.getPresentableText());