diff python/pydc/pydcext.c @ 44:0f86a5ecfe61

- python: allow None to be passed for 'p'ointers, always passing NULL
author Tassilo Philipp
date Tue, 27 Oct 2020 18:44:18 +0100
parents 1086ca649715
children
line wrap: on
line diff
--- a/python/pydc/pydcext.c	Wed Apr 15 21:58:13 2020 +0200
+++ b/python/pydc/pydcext.c	Tue Oct 27 18:44:18 2020 +0100
@@ -359,6 +359,8 @@
 #endif
 				else if ( PyLong_Check(po) )
 					p = (DCpointer) PyLong_AsVoidPtr(po);
+				else if ( po == Py_None )
+					p = NULL;
 				else
 					return PyErr_Format( PyExc_RuntimeError, "arg %d - expecting a promoting pointer-type (int, bytearray)", pos );
 				dcArgPointer(gpCall, p);