Commit 8ef355cf authored by Lada Gagina's avatar Lada Gagina
Browse files

PY-20673 Consider a function empty only if it contains ellipsis (but not None)

parent 87309b4e
Branches unavailable Tags unavailable
No related merge requests found
Showing with 4 additions and 1 deletion
+4 -1
......@@ -1858,7 +1858,10 @@ public class PyUtil {
return true;
}
if (stmt instanceof PyExpressionStatement && ((PyExpressionStatement)stmt).getExpression() instanceof PyNoneLiteralExpression) {
return true; // ellipsis
PyExpression expr = ((PyExpressionStatement)stmt).getExpression();
if (((PyNoneLiteralExpression)expr).isEllipsis()) {
return true;
}
}
if (stmt instanceof PyReturnStatement && ((PyReturnStatement)stmt).getExpression() == null) {
return true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment