* Convert an integer to a reference to an IntEnum or IntFlag in pygit2.enums. */
| 225 | * Convert an integer to a reference to an IntEnum or IntFlag in pygit2.enums. |
| 226 | */ |
| 227 | PyObject * |
| 228 | pygit2_enum(PyObject *enum_type, int value) |
| 229 | { |
| 230 | if (!enum_type) { |
| 231 | PyErr_SetString(PyExc_TypeError, "an enum has not been cached in _pygit2.cache_enums()"); |
| 232 | return NULL; |
| 233 | } |
| 234 | PyObject *enum_instance = PyObject_CallFunction(enum_type, "(i)", value); |
| 235 | return enum_instance; |
| 236 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…