mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2025-01-01 08:59:40 +00:00
Allow taking None
in Abi.fromStr
This commit is contained in:
parent
a5ef766311
commit
9300da772e
@ -15,7 +15,7 @@ class Abi:
|
||||
N64: Enum
|
||||
|
||||
@staticmethod
|
||||
def fromStr(name: str) -> Enum: ...
|
||||
def fromStr(name: str | None) -> Enum: ...
|
||||
|
||||
|
||||
class _RabbitizerConfig:
|
||||
|
@ -24,7 +24,7 @@ static PyObject *rabbitizer_enum_Abi_fromStr(UNUSED PyObject *self, PyObject *ar
|
||||
RabbitizerAbi abi;
|
||||
PyObject *ret;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &name)) {
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "z", kwlist, &name)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <string.h>
|
||||
|
||||
RabbitizerAbi RabbitizerAbi_fromStr(const char *name) {
|
||||
if (strcmp(name, "32") == 0 || strcmp(name, "o32") == 0 || strcmp(name, "O32") == 0) {
|
||||
if (name == NULL || strcmp(name, "32") == 0 || strcmp(name, "o32") == 0 || strcmp(name, "O32") == 0) {
|
||||
return RABBITIZER_ABI_O32;
|
||||
}
|
||||
if (strcmp(name, "n32") == 0 || strcmp(name, "N32") == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user