diff --git a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/intentions/ImportToImportFromIntention.java b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/intentions/ImportToImportFromIntention.java index d81a18d75a2f..8bae898e4785 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/intentions/ImportToImportFromIntention.java +++ b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/intentions/ImportToImportFromIntention.java @@ -158,12 +158,7 @@ public final class ImportToImportFromIntention extends PsiBasedModCommandAction< else { if (canRemoveImport) { // cut the module out of import, add a from-import. - for (PyImportElement pie : importElements) { - if (pie == myImportElement) { - pie.delete(); - break; - } - } + myImportElement.delete(); } parent.addAfter(newImportStatement, importStatement); }