Skip to content

Commit 0c243f6

Browse files
Correct Python None usage in C layer
1 parent b8fe284 commit 0c243f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extern/load_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static PyObject* p11_error() {
1919
LocalFree(msgbuffer);
2020
return errmsg;
2121
} else {
22-
return NULL;
22+
Py_RETURN_NONE;
2323
}
2424
}
2525

@@ -57,7 +57,7 @@ static PyObject* p11_error() {
5757
char* error = dlerror();
5858

5959
if (error == NULL) {
60-
return NULL;
60+
Py_RETURN_NONE;
6161
}
6262
int len = strlen(error);
6363
PyObject* result = PyUnicode_DecodeUTF8(error, len, NULL);

0 commit comments

Comments
 (0)