fixed PY-2914: RE at com.jetbrains.python.psi.impl.PyBaseElementImpl.childToPsiNotNull

This commit is contained in:
Ekaterina Tuzova
2011-02-14 13:01:27 +03:00
parent 00454929a7
commit 09642866d4
2 changed files with 4 additions and 4 deletions
@@ -81,8 +81,8 @@ public class PyDictConstructorToLiteralFormIntention extends BaseIntentionAction
}
}
PyExpressionStatement dict = elementGenerator.createFromText(LanguageLevel.forElement(expression), PyExpressionStatement.class,
"{" + stringBuilder.toString() + "}");
PyDictLiteralExpression dict = (PyDictLiteralExpression)elementGenerator.createFromText(LanguageLevel.forElement(expression), PyExpressionStatement.class,
"{" + stringBuilder.toString() + "}").getExpression();
expression.replace(dict);
}
}
@@ -126,8 +126,8 @@ public class PyDictLiteralFormToConstructorIntention extends BaseIntentionAction
}
}
stringBuilder.append(")");
PyStatement callExpression = elementGenerator.createFromText(LanguageLevel.forElement(dictExpression),
PyStatement.class, stringBuilder.toString());
PyCallExpression callExpression = (PyCallExpression)elementGenerator.createFromText(LanguageLevel.forElement(dictExpression),
PyExpressionStatement.class, stringBuilder.toString()).getExpression();
dictExpression.replace(callExpression);
}
}