Skip to content

Commit 606ad64

Browse files
committed
get rid of major/minor hardcoded values in PythonLanguage
1 parent 7c2b38e commit 606ad64

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ public final class PythonLanguage extends TruffleLanguage<PythonContext> {
188188
* a GraalVM build, but we may run from Jar files directly during development. We generate the
189189
* version during the build that are checked against these constants.
190190
*/
191-
public static final int GRAALVM_MAJOR = 24;
192-
public static final int GRAALVM_MINOR = 1;
191+
public static final int GRAALVM_MAJOR;
192+
public static final int GRAALVM_MINOR;
193193
public static final String DEV_TAG;
194194

195195
/**
@@ -226,12 +226,8 @@ public final class PythonLanguage extends TruffleLanguage<PythonContext> {
226226
if (MICRO != (ch = is.read() - VERSION_BASE)) {
227227
throw new RuntimeException("suite.py version info does not match PythonLanguage#MICRO: " + ch);
228228
}
229-
if (GRAALVM_MAJOR != (ch = is.read() - VERSION_BASE)) {
230-
throw new RuntimeException("suite.py version info does not match PythonLanguage#GRAALVM_MAJOR: " + ch);
231-
}
232-
if (GRAALVM_MINOR != (ch = is.read() - VERSION_BASE)) {
233-
throw new RuntimeException("suite.py version info does not match PythonLanguage#GRAALVM_MINOR: " + ch);
234-
}
229+
GRAALVM_MAJOR = is.read() - VERSION_BASE;
230+
GRAALVM_MINOR = is.read() - VERSION_BASE;
235231
is.read(); // skip GraalVM micro version
236232
// see mx.graalpython/mx_graalpython.py:dev_tag
237233
byte[] rev = new byte[3 /* 'dev' */ + 10 /* revision */];

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonOptions.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ private PythonOptions() {
112112
@Option(category = OptionCategory.EXPERT, help = "Set the location of sys.base_prefix. Overrides any environment variables or Java options.", usageSyntax = "<path>", stability = OptionStability.STABLE) //
113113
public static final OptionKey<TruffleString> SysBasePrefix = new OptionKey<>(T_EMPTY_STRING, TS_OPTION_TYPE);
114114

115-
@Option(category = OptionCategory.USER, help = "Set the location of lib/graalpy" + PythonLanguage.GRAALVM_MAJOR + "." + //
116-
PythonLanguage.GRAALVM_MINOR + ". Overrides any environment variables or Java options.", //
115+
@Option(category = OptionCategory.USER, help = "Set the location of what is usually lib/graalpy<graalvm_major>.<graalvm_minor>. Overrides any environment variables or Java options.", //
117116
usageSyntax = "<path>", stability = OptionStability.STABLE) //
118117
public static final OptionKey<TruffleString> CoreHome = new OptionKey<>(T_EMPTY_STRING, TS_OPTION_TYPE);
119118

0 commit comments

Comments
 (0)