File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 4848
4949public class LazyString implements CharSequence {
5050
51- protected static int MinLazyStringLength = PythonOptions .getMinLazyStringLength ();
52- protected static boolean UseLazyStrings = PythonOptions .useLazyString ();
51+ protected static final int MinLazyStringLength ;
52+ protected static final boolean UseLazyStrings ;
53+ static {
54+ boolean useLazyStrings = PythonOptions .LazyStrings .getDefaultValue ();
55+ int minLazyStringLength = PythonOptions .MinLazyStringLength .getDefaultValue ();
56+ try {
57+ useLazyStrings = PythonOptions .useLazyString ();
58+ minLazyStringLength = PythonOptions .getMinLazyStringLength ();
59+ } catch (AssertionError e ) {
60+ // This can happen e.g. when we build a native image without
61+ // a pre-initialized Python context
62+ assert e .getMessage ().equals ("No current context available" );
63+ }
64+ MinLazyStringLength = minLazyStringLength ;
65+ UseLazyStrings = useLazyStrings ;
66+ }
5367
5468 public static int length (CharSequence cs , ConditionProfile profile1 , ConditionProfile profile2 ) {
5569 if (profile1 .profile (cs instanceof String )) {
You can’t perform that action at this time.
0 commit comments