Skip to content

Commit 58f5521

Browse files
committed
Fix native string comparison
1 parent 56b00ef commit 58f5521

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object/DefaultPythonStringExports.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ static int ss(String receiver, String other, @SuppressWarnings("unused") ThreadS
9292
}
9393

9494
@Specialization
95-
static int sP(String receiver, PString other, @SuppressWarnings("unused") ThreadState threadState,
95+
static int sP(String receiver, Object other, @SuppressWarnings("unused") ThreadState threadState,
9696
@Cached CastToJavaStringNode castNode,
9797
@Shared("gil") @Cached GilNode gil) {
9898
boolean mustRelease = gil.acquire();
9999
try {
100100
// n.b.: subclassing is ignored in this direction in CPython
101-
String otherString = null;
101+
String otherString;
102102
try {
103103
otherString = castNode.execute(other);
104104
} catch (CannotCastException e) {
@@ -109,12 +109,6 @@ static int sP(String receiver, PString other, @SuppressWarnings("unused") Thread
109109
gil.release(mustRelease);
110110
}
111111
}
112-
113-
@Fallback
114-
@SuppressWarnings("unused")
115-
static int iO(String receiver, Object other, @SuppressWarnings("unused") ThreadState threadState) {
116-
return -1;
117-
}
118112
}
119113

120114
@ExportMessage

0 commit comments

Comments
 (0)