Skip to content

Commit cb61f18

Browse files
committed
fix style
1 parent a4b7f24 commit cb61f18

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
import java.io.OutputStream;
3737
import java.nio.file.LinkOption;
3838
import java.text.MessageFormat;
39+
import java.util.ArrayDeque;
3940
import java.util.ArrayList;
4041
import java.util.HashMap;
4142
import java.util.List;
42-
import java.util.Stack;
4343
import java.util.concurrent.atomic.AtomicLong;
4444
import java.util.concurrent.locks.ReentrantLock;
4545
import java.util.function.Supplier;
@@ -145,7 +145,7 @@ public final class PythonContext {
145145

146146
// A thread-local to store the full path to the currently active import statement, for Jython
147147
// compat
148-
private final ThreadLocal<Stack<String>> currentImport = new ThreadLocal<>();
148+
private final ThreadLocal<ArrayDeque<String>> currentImport = new ThreadLocal<>();
149149

150150
public PythonContext(PythonLanguage language, TruffleLanguage.Env env, PythonCore core) {
151151
this.language = language;
@@ -729,10 +729,8 @@ public boolean isPyFileInLanguageHome(TruffleFile path) {
729729

730730
@TruffleBoundary
731731
public String getCurrentImport() {
732-
Stack<String> ci = currentImport.get();
733-
if (ci == null) {
734-
return "";
735-
} else if (ci.isEmpty()) {
732+
ArrayDeque<String> ci = currentImport.get();
733+
if (ci == null || ci.isEmpty()) {
736734
return "";
737735
} else {
738736
return ci.peek();
@@ -741,9 +739,9 @@ public String getCurrentImport() {
741739

742740
@TruffleBoundary
743741
public void pushCurrentImport(String object) {
744-
Stack<String> ci = currentImport.get();
742+
ArrayDeque<String> ci = currentImport.get();
745743
if (ci == null) {
746-
ci = new Stack<>();
744+
ci = new ArrayDeque<>();
747745
currentImport.set(ci);
748746
}
749747
ci.push(object);

mx.graalpython/mx_graalpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# compatibility between Python versions
5454
PY3 = sys.version_info[0] == 3
5555
if PY3:
56-
raw_input = input
56+
raw_input = input # pylint: disable=redefined-builtin;
5757

5858

5959
def _get_core_home():

0 commit comments

Comments
 (0)