@@ -420,25 +420,31 @@ int _SdBus_match_signal_instant_callback(sd_bus_message* m, void* userdata, sd_b
420420}
421421
422422#ifndef Py_LIMITED_API
423+
424+ static int _unicode_or_none (PyObject * some_object ) {
425+ return (PyUnicode_Check (some_object ) || (Py_None == some_object ));
426+ }
427+
423428static PyObject * SdBus_get_signal_queue (SdBusObject * self , PyObject * const * args , Py_ssize_t nargs ) {
424429 SD_BUS_PY_CHECK_ARGS_NUMBER (4 );
425- SD_BUS_PY_CHECK_ARG_TYPE (0 , PyUnicode_Type );
426- SD_BUS_PY_CHECK_ARG_TYPE (1 , PyUnicode_Type );
427- SD_BUS_PY_CHECK_ARG_TYPE (2 , PyUnicode_Type );
428- SD_BUS_PY_CHECK_ARG_TYPE (3 , PyUnicode_Type );
429430
430- const char * sender_service_char_ptr = SD_BUS_PY_UNICODE_AS_CHAR_PTR (args [0 ]);
431- const char * path_name_char_ptr = SD_BUS_PY_UNICODE_AS_CHAR_PTR (args [1 ]);
432- const char * interface_name_char_ptr = SD_BUS_PY_UNICODE_AS_CHAR_PTR (args [2 ]);
433- const char * member_name_char_ptr = SD_BUS_PY_UNICODE_AS_CHAR_PTR (args [3 ]);
431+ SD_BUS_PY_CHECK_ARG_CHECK_FUNC (0 , _unicode_or_none );
432+ SD_BUS_PY_CHECK_ARG_CHECK_FUNC (1 , _unicode_or_none );
433+ SD_BUS_PY_CHECK_ARG_CHECK_FUNC (2 , _unicode_or_none );
434+ SD_BUS_PY_CHECK_ARG_CHECK_FUNC (3 , _unicode_or_none );
435+
436+ const char * sender_service_char_ptr = SD_BUS_PY_UNICODE_AS_CHAR_PTR_OPTIONAL (args [0 ]);
437+ const char * path_name_char_ptr = SD_BUS_PY_UNICODE_AS_CHAR_PTR_OPTIONAL (args [1 ]);
438+ const char * interface_name_char_ptr = SD_BUS_PY_UNICODE_AS_CHAR_PTR_OPTIONAL (args [2 ]);
439+ const char * member_name_char_ptr = SD_BUS_PY_UNICODE_AS_CHAR_PTR_OPTIONAL (args [3 ]);
434440#else
435441static PyObject * SdBus_get_signal_queue (SdBusObject * self , PyObject * args ) {
436442 const char * sender_service_char_ptr = NULL ;
437443 const char * path_name_char_ptr = NULL ;
438444 const char * interface_name_char_ptr = NULL ;
439445 const char * member_name_char_ptr = NULL ;
440446 CALL_PYTHON_BOOL_CHECK (
441- PyArg_ParseTuple (args , "ssss " , & sender_service_char_ptr , & path_name_char_ptr , & interface_name_char_ptr , & member_name_char_ptr , NULL ));
447+ PyArg_ParseTuple (args , "zzzz " , & sender_service_char_ptr , & path_name_char_ptr , & interface_name_char_ptr , & member_name_char_ptr , NULL ));
442448#endif
443449 SdBusSlotObject * new_slot CLEANUP_SD_BUS_SLOT = (SdBusSlotObject * )CALL_PYTHON_AND_CHECK (PyObject_CallFunctionObjArgs (SdBusSlot_class , NULL ));
444450
0 commit comments