Skip to content

Commit 64a4ed3

Browse files
committed
Fix: pass 'PythonNativeNull' through 'AsPythonObjectNode'.
1 parent 5c8e56d commit 64a4ed3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

graalpython/com.oracle.graal.python.cext/src/capi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static void initialize_capi() {
195195
MUST_INLINE
196196
void* native_to_java(PyObject* obj) {
197197
if (obj == NULL) {
198-
return wrapped_null;
198+
return Py_NoValue;
199199
} else if (obj == Py_None) {
200200
return Py_None;
201201
} else if (polyglot_is_string(obj)) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,8 @@ abstract static class PyTruffle_Unicode_DecodeUTF32 extends NativeUnicodeBuiltin
10511051

10521052
@Child private CExtNodes.ToSulongNode toSulongNode;
10531053

1054-
@Specialization(guards = "isByteArray(o)")
1055-
Object doUnicode(TruffleObject o, long size, @SuppressWarnings("unused") PythonNativeNull errors, int byteorder, Object errorMarker) {
1054+
@Specialization(guards = {"isByteArray(o)", "isNoValue(errors)"})
1055+
Object doUnicode(TruffleObject o, long size, @SuppressWarnings("unused") PNone errors, int byteorder, Object errorMarker) {
10561056
return doUnicode(o, size, "strict", byteorder, errorMarker);
10571057
}
10581058

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/CExtNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ PythonAbstractObject doNativeObject(TruffleObject object) {
392392
}
393393

394394
@Specialization
395-
PNone doNativeNull(@SuppressWarnings("unused") PythonNativeNull object) {
396-
return PNone.NO_VALUE;
395+
PythonNativeNull doNativeNull(@SuppressWarnings("unused") PythonNativeNull object) {
396+
return object;
397397
}
398398

399399
@Specialization

0 commit comments

Comments
 (0)