Skip to content

Commit 51505b5

Browse files
committed
Fix wrong import and ErrorMessages order, reset PythonOptions to master.
The eclipse formatter reformatted the PythonOptions file which than caused issues at start-up, resetting it to the format on master solved the issues.
1 parent fc7205a commit 51505b5

File tree

6 files changed

+42
-61
lines changed

6 files changed

+42
-61
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ctypes/CtypesNodes.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@
4040
*/
4141
package com.oracle.graal.python.builtins.modules.ctypes;
4242

43+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCArray;
44+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCArrayType;
45+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCData;
46+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCFuncPtr;
47+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCFuncPtrType;
48+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCPointer;
49+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCPointerType;
50+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCSimpleType;
51+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCStructType;
52+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.SimpleCData;
53+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.UnionType;
54+
import static com.oracle.graal.python.builtins.objects.cext.capi.NativeCAPISymbol.FUN_DEREF_HANDLE;
55+
4356
import com.oracle.graal.python.builtins.modules.ctypes.FFIType.FFI_TYPES;
4457
import com.oracle.graal.python.builtins.objects.cext.capi.CExtNodes.PCallCapiFunction;
4558
import com.oracle.graal.python.builtins.objects.str.PString;
@@ -54,19 +67,6 @@
5467
import com.oracle.truffle.api.memory.ByteArraySupport;
5568
import com.oracle.truffle.api.nodes.Node;
5669

57-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCArray;
58-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCArrayType;
59-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCData;
60-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCFuncPtr;
61-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCFuncPtrType;
62-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCPointer;
63-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCPointerType;
64-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCSimpleType;
65-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.PyCStructType;
66-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.SimpleCData;
67-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.UnionType;
68-
import static com.oracle.graal.python.builtins.objects.cext.capi.NativeCAPISymbol.FUN_DEREF_HANDLE;
69-
7070
public class CtypesNodes {
7171

7272
@GenerateUncached

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/lib/PyNumberFloatNode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
*/
4141
package com.oracle.graal.python.lib;
4242

43+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.DeprecationWarning;
44+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.TypeError;
45+
import static com.oracle.graal.python.nodes.SpecialMethodNames.__FLOAT__;
46+
4347
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
4448
import com.oracle.graal.python.builtins.modules.WarningsModuleBuiltins;
4549
import com.oracle.graal.python.builtins.objects.PNone;
@@ -60,10 +64,6 @@
6064
import com.oracle.truffle.api.frame.Frame;
6165
import com.oracle.truffle.api.frame.VirtualFrame;
6266

63-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.DeprecationWarning;
64-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.TypeError;
65-
import static com.oracle.graal.python.nodes.SpecialMethodNames.__FLOAT__;
66-
6767
/**
6868
* Equivalent of CPython's {@code PyNumber_Float}. Converts the argument to a Java {@code double}
6969
* using its {@code __float__} special method. If not available, falls back to {@code __index__}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/ErrorMessages.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ public abstract class ErrorMessages {
246246
public static final String EXPECTED_AT_MOST_D_ARGS_GOT_D = "%s expected at most %d arguments, got %d";
247247
public static final String EXPECTED_BYTESLIKE_GOT_P = "expected a bytes-like object, %p found";
248248
public static final String EXPECTED_CHARACTER_BUT_STRING_FOUND = "%s expected a character, but string of length %d found";
249-
public static final String MUST_BE_ONE_CHARACTER_STRING = "\"%s\" must be a 1-character string";
250249
public static final String EXPECTED_CONVERSION = "expected conversion";
251250
public static final String EXPECTED_FSPATH_TO_RETURN_STR_OR_BYTES = "expected %p.__fspath__() to return str or bytes, not %p";
252251
public static final String EXPECTED_OBJ_TYPE_S_GOT_P = "expected object of type %s, got %p";
@@ -1005,7 +1004,7 @@ public abstract class ErrorMessages {
10051004
public static final String CANNOT_PICKLE_OBJECT_TYPE = "cannot pickle '%p' object";
10061005

10071006
// csv errors
1008-
1007+
public static final String MUST_BE_ONE_CHARACTER_STRING = "\"%s\" must be a 1-character string";
10091008
public static final String DELIMITER_MUST_BE_ONE_CHAR_STRING = "\"delimiter\" must be a 1-character string";
10101009
public static final String QUOTECHAR_MUST_BE_SET_IF_QUOTING_ENABLED = "quotechar must be set if quoting enabled";
10111010
public static final String LINETERMINATOR_MUST_BE_SET = "lineterminator must be set";

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/control/GetNextNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
*/
4141
package com.oracle.graal.python.nodes.control;
4242

43+
import static com.oracle.graal.python.nodes.SpecialMethodNames.__NEXT__;
44+
import static com.oracle.truffle.api.nodes.NodeCost.NONE;
45+
4346
import com.oracle.graal.python.builtins.objects.PNone;
4447
import com.oracle.graal.python.builtins.objects.type.SpecialMethodSlot;
4548
import com.oracle.graal.python.nodes.ErrorMessages;
@@ -58,9 +61,6 @@
5861
import com.oracle.truffle.api.nodes.NodeInfo;
5962
import com.oracle.truffle.api.nodes.UnexpectedResultException;
6063

61-
import static com.oracle.graal.python.nodes.SpecialMethodNames.__NEXT__;
62-
import static com.oracle.truffle.api.nodes.NodeCost.NONE;
63-
6464
public abstract class GetNextNode extends PNodeWithContext {
6565
public abstract Object execute(Frame frame, Object iterator);
6666

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/function/BuiltinFunctionRootNode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
*/
2626
package com.oracle.graal.python.nodes.function;
2727

28+
import java.util.ArrayList;
29+
import java.util.Arrays;
30+
import java.util.List;
31+
2832
import com.oracle.graal.python.PythonLanguage;
2933
import com.oracle.graal.python.builtins.Builtin;
3034
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
@@ -58,10 +62,6 @@
5862
import com.oracle.truffle.api.nodes.Node;
5963
import com.oracle.truffle.api.nodes.NodeUtil;
6064

61-
import java.util.ArrayList;
62-
import java.util.Arrays;
63-
import java.util.List;
64-
6565
/**
6666
* CPython wraps built-in types' slots so the C can take the direct arguments. The slot wrappers for
6767
* binary and ternay functions (wrap_unaryfunc, wrap_binaryfunc_r, wrap_ternaryfunc,

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

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ private PythonOptions() {
110110
@Option(category = OptionCategory.USER, help = "Equivalent to setting the PYTHONPATH environment variable for the standard launcher. ':'-separated list of directories prefixed to the default module search path.", stability = OptionStability.STABLE) //
111111
public static final OptionKey<String> PythonPath = new OptionKey<>("");
112112

113-
@EngineOption
114-
@Option(category = OptionCategory.USER, help = "Equivalent to setting the PYTHONIOENCODING environment variable for the standard launcher. Format: Encoding[:errors]", stability = OptionStability.STABLE) //
113+
@EngineOption @Option(category = OptionCategory.USER, help = "Equivalent to setting the PYTHONIOENCODING environment variable for the standard launcher. Format: Encoding[:errors]", stability = OptionStability.STABLE) //
115114
public static final OptionKey<String> StandardStreamEncoding = new OptionKey<>("");
116115

117116
@Option(category = OptionCategory.USER, help = "Remove assert statements and any code conditional on the value of __debug__.", stability = OptionStability.STABLE) //
@@ -137,7 +136,6 @@ private PythonOptions() {
137136
@Option(category = OptionCategory.USER, help = "Equivalent to setting the PYTHONWARNINGS environment variable for the standard launcher.", stability = OptionStability.STABLE) //
138137
public static final OptionKey<String> WarnOptions = new OptionKey<>("");
139138

140-
@EngineOption
141139
@Option(category = OptionCategory.USER, help = "Equivalent to setting PYTHONHASHSEED environment variable", stability = OptionStability.STABLE) //
142140
public static final OptionKey<Optional<Integer>> HashSeed = new OptionKey<>(Optional.empty(),
143141
new OptionType<>("HashSeed", input -> {
@@ -168,12 +166,10 @@ private PythonOptions() {
168166
@Option(category = OptionCategory.INTERNAL, help = "Set the location of C API home. Overrides any environment variables or Java options.", stability = OptionStability.STABLE) //
169167
public static final OptionKey<String> CAPI = new OptionKey<>("");
170168

171-
@EngineOption
172-
@Option(category = OptionCategory.INTERNAL, help = "Expose internal sources as normal sources, so they will show up in the debugger and stacks") //
169+
@EngineOption @Option(category = OptionCategory.INTERNAL, help = "Expose internal sources as normal sources, so they will show up in the debugger and stacks") //
173170
public static final OptionKey<Boolean> ExposeInternalSources = new OptionKey<>(false);
174171

175-
@EngineOption
176-
@Option(category = OptionCategory.INTERNAL, help = "Print the java stacktrace. Possible modes:" +
172+
@EngineOption @Option(category = OptionCategory.INTERNAL, help = "Print the java stacktrace. Possible modes:" +
177173
" 1 Print Java stacktrace for Java exceptions only." +
178174
" 2 Print Java stacktrace for Python exceptions only (ATTENTION: this will have a notable performance impact)." +
179175
" 3 Combines 1 and 2.") //
@@ -182,16 +178,13 @@ private PythonOptions() {
182178
@Option(category = OptionCategory.INTERNAL, help = "") //
183179
public static final OptionKey<Boolean> CatchGraalPythonExceptionForUnitTesting = new OptionKey<>(false);
184180

185-
@EngineOption
186-
@Option(category = OptionCategory.INTERNAL, help = "Enable catching all Exceptions in generic try-catch statements.") //
181+
@EngineOption @Option(category = OptionCategory.INTERNAL, help = "Enable catching all Exceptions in generic try-catch statements.") //
187182
public static final OptionKey<Boolean> CatchAllExceptions = new OptionKey<>(false);
188183

189-
@EngineOption
190-
@Option(category = OptionCategory.INTERNAL, help = "Choose the backend for HPy binary mode.", stability = OptionStability.EXPERIMENTAL) //
184+
@EngineOption @Option(category = OptionCategory.INTERNAL, help = "Choose the backend for HPy binary mode.", stability = OptionStability.EXPERIMENTAL) //
191185
public static final OptionKey<HPyBackendMode> HPyBackend = new OptionKey<>(HPyBackendMode.JNI, HPY_BACKEND_TYPE);
192186

193-
@EngineOption
194-
@Option(category = OptionCategory.INTERNAL, help = "If {@code true}, code is enabled that tries to reduce expensive upcalls into the runtime" +
187+
@EngineOption @Option(category = OptionCategory.INTERNAL, help = "If {@code true}, code is enabled that tries to reduce expensive upcalls into the runtime" +
195188
"when HPy API functions are used. This is achieved by mirroring data in native memory.", stability = OptionStability.EXPERIMENTAL) //
196189
public static final OptionKey<Boolean> HPyEnableJNIFastPaths = new OptionKey<>(true);
197190

@@ -204,28 +197,22 @@ private PythonOptions() {
204197
@Option(category = OptionCategory.EXPERT, help = "Prints parser time statistics after number of parsed files, set by this option. 0 or <0 means no statistics are printed.") //
205198
public static final OptionKey<Integer> ParserStatistics = new OptionKey<>(0);
206199

207-
@EngineOption
208-
@Option(category = OptionCategory.EXPERT, help = "") //
200+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "") //
209201
public static final OptionKey<Integer> AttributeAccessInlineCacheMaxDepth = new OptionKey<>(5);
210202

211-
@EngineOption
212-
@Option(category = OptionCategory.EXPERT, help = "") //
203+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "") //
213204
public static final OptionKey<Integer> CallSiteInlineCacheMaxDepth = new OptionKey<>(4);
214205

215-
@EngineOption
216-
@Option(category = OptionCategory.EXPERT, help = "") //
206+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "") //
217207
public static final OptionKey<Integer> VariableArgumentReadUnrollingLimit = new OptionKey<>(5);
218208

219-
@EngineOption
220-
@Option(category = OptionCategory.EXPERT, help = "") //
209+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "") //
221210
public static final OptionKey<Integer> VariableArgumentInlineCacheLimit = new OptionKey<>(3);
222211

223-
@EngineOption
224-
@Option(category = OptionCategory.EXPERT, help = "") //
212+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "") //
225213
public static final OptionKey<Integer> NodeRecursionLimit = new OptionKey<>(1);
226214

227-
@EngineOption
228-
@Option(category = OptionCategory.EXPERT, help = "") //
215+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "") //
229216
public static final OptionKey<Boolean> ForceInlineGeneratorCalls = new OptionKey<>(false);
230217

231218
@Option(category = OptionCategory.EXPERT, help = "Force to automatically import site.py module.") //
@@ -242,19 +229,16 @@ private PythonOptions() {
242229

243230
// disabling TRegex has an effect on the _sre Python functions that are
244231
// dynamically created, so we cannot change that option again.
245-
@EngineOption
246-
@Option(category = OptionCategory.EXPERT, help = "Use the optimized TRegex engine. Default true") //
232+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "Use the optimized TRegex engine. Default true") //
247233
public static final OptionKey<Boolean> WithTRegex = new OptionKey<>(true);
248234

249-
@EngineOption
250-
@Option(category = OptionCategory.EXPERT, help = "Use the CPython sre engine as a fallback to the TRegex engine.") //
235+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "Use the CPython sre engine as a fallback to the TRegex engine.") //
251236
public static final OptionKey<Boolean> TRegexUsesSREFallback = new OptionKey<>(true);
252237

253238
@Option(category = OptionCategory.EXPERT, help = "Switch on/off using lazy strings for performance reasons. Default true.") //
254239
public static final OptionKey<Boolean> LazyStrings = new OptionKey<>(true);
255240

256-
@EngineOption
257-
@Option(category = OptionCategory.EXPERT, help = "Enable forced splitting (of builtins). Default false.") //
241+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "Enable forced splitting (of builtins). Default false.") //
258242
public static final OptionKey<Boolean> EnableForcedSplits = new OptionKey<>(false);
259243

260244
@Option(category = OptionCategory.EXPERT, help = "Set by the launcher if an interactive console is used to run Python.") //
@@ -278,8 +262,7 @@ private PythonOptions() {
278262
@Option(category = OptionCategory.EXPERT, help = "Embedder option: what to print in response to PythonLanguage#toString.") //
279263
public static final OptionKey<Boolean> UseReprForPrintString = new OptionKey<>(true);
280264

281-
@EngineOption
282-
@Option(category = OptionCategory.EXPERT, help = "Stop inlining of builtins if caller's cumulative tree size would exceed this limit") //
265+
@EngineOption @Option(category = OptionCategory.EXPERT, help = "Stop inlining of builtins if caller's cumulative tree size would exceed this limit") //
283266
public static final OptionKey<Integer> BuiltinsInliningMaxCallerSize = new OptionKey<>(2250);
284267

285268
@Option(category = OptionCategory.EXPERT, help = "Disable weakref callback processing, signal handling, and other periodic async actions.") //
@@ -288,8 +271,7 @@ private PythonOptions() {
288271
@Option(category = OptionCategory.EXPERT, help = "Propagate append operations to lists created as literals back to where they were created, to inform overallocation to avoid having to grow them later.") //
289272
public static final OptionKey<Boolean> OverallocateLiteralLists = new OptionKey<>(true);
290273

291-
@EngineOption
292-
@Option(category = OptionCategory.USER, help = "Emulate some Jython features that can cause performance degradation") //
274+
@EngineOption @Option(category = OptionCategory.USER, help = "Emulate some Jython features that can cause performance degradation") //
293275
public static final OptionKey<Boolean> EmulateJython = new OptionKey<>(false);
294276

295277
@Option(category = OptionCategory.EXPERT, help = "Enable tracing of native memory (ATTENTION: this will have significant impact on CExt execution performance).") //

0 commit comments

Comments
 (0)