[python] Fix nullability annotations (PyAstNumericLiteralExpression)

GitOrigin-RevId: d5db0add83ac134aab91198b1a931c026829d216
This commit is contained in:
Petr
2024-07-28 15:43:22 +00:00
committed by intellij-monorepo-bot
parent 38ee9327a6
commit 7f22ee443e
4 changed files with 15 additions and 30 deletions
@@ -73,7 +73,7 @@ data class PyVersionCheck(val version: Version, val isLessThan: Boolean) {
private fun evaluateNumber(expression: PyAstExpression?): Int? {
if (expression !is PyAstNumericLiteralExpression) return null
if (!expression.isIntegerLiteral) return null
val value = expression.bigIntegerValue ?: return null
val value = expression.bigIntegerValue
val intValue = value.toInt()
return if (BigInteger.valueOf(intValue.toLong()) == value) intValue else null
}