From 0f948ef5f044067930fb13e6891b528db3af4017 Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Fri, 16 Oct 2020 11:53:37 +0300 Subject: [PATCH] Align inner representation of python 2 versions with python 3 GitOrigin-RevId: 268e221f9082fd5c26479822c02a233ea99a7663 --- .../com/jetbrains/python/psi/LanguageLevel.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/python-psi-api/src/com/jetbrains/python/psi/LanguageLevel.java b/python/python-psi-api/src/com/jetbrains/python/psi/LanguageLevel.java index 302dae7dbcd3..d90552903820 100644 --- a/python/python-psi-api/src/com/jetbrains/python/psi/LanguageLevel.java +++ b/python/python-psi-api/src/com/jetbrains/python/psi/LanguageLevel.java @@ -35,16 +35,16 @@ public enum LanguageLevel { /** * @apiNote This level is not supported since 2018.1. */ - PYTHON24(24), + PYTHON24(204), /** * @apiNote This level is not supported since 2018.1. */ - PYTHON25(25), + PYTHON25(205), /** * @apiNote This level is not supported since 2019.1. */ - PYTHON26(26), - PYTHON27(27), + PYTHON26(206), + PYTHON27(207), /** * @apiNote This level is not supported since 2018.1. * Use it only to distinguish Python 2 and Python 3. @@ -87,7 +87,7 @@ public enum LanguageLevel { ImmutableList.copyOf( Stream .of(values()) - .filter(v -> v.myVersion > 305 || v.myVersion == 27) + .filter(v -> v.isAtLeast(PYTHON36) || v == PYTHON27) .collect(Collectors.toList()) ); @@ -120,11 +120,11 @@ public enum LanguageLevel { } public int getMajorVersion() { - return myVersion < 100 ? myVersion / 10 : myVersion / 100; + return myVersion / 100; } public int getMinorVersion() { - return myVersion < 100 ? myVersion % 10 : myVersion % 100; + return myVersion % 100; } public boolean hasPrintStatement() {