Skip to content

Commit 060947b

Browse files
committed
PyUnicode_Compare has to return 1 if greater than
1 parent acb6d44 commit 060947b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,9 +2541,9 @@ Object check(VirtualFrame frame, Object obj,
25412541
} catch (PException e) {
25422542
transformExceptionToNativeNode.execute(e);
25432543
return getNativeNullNode.execute();
2544-
}
25452544
}
25462545
}
2546+
}
25472547

25482548
@Builtin(name = "PyNumber_Index", minNumOfPositionalArgs = 1)
25492549
@GenerateNodeFactory
@@ -3360,7 +3360,7 @@ public Object compare(VirtualFrame frame, Object left, Object right,
33603360
if (eqProfile.profile((boolean) eqNode.execute(frame, left, right))) {
33613361
return 0;
33623362
} else {
3363-
return (boolean) ltNode.execute(frame, left, right) ? -1 : 0;
3363+
return (boolean) ltNode.execute(frame, left, right) ? -1 : 1;
33643364
}
33653365
}
33663366

0 commit comments

Comments
 (0)