Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-06-26 10:26:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-26 10:31:57 +0300
commita69f985f40905b01cf542d370831e7ade138a4e3 (patch)
tree17f1e926a9f09a9461967efa92a8daedc344fc4d /source/blender/python/generic
parent87f598fd3f2b7968af0620b98f16bb86aa17d541 (diff)
PyAPI: move deep-copy args check to py_capi_utils
Diffstat (limited to 'source/blender/python/generic')
-rw-r--r--source/blender/python/generic/py_capi_utils.c6
-rw-r--r--source/blender/python/generic/py_capi_utils.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 22646462163..cee9ad3b477 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -230,6 +230,12 @@ int PyC_ParseBool(PyObject *o, void *p)
return 1;
}
+/* silly function, we dont use arg. just check its compatible with __deepcopy__ */
+int PyC_CheckArgs_DeepCopy(PyObject *args)
+{
+ PyObject *dummy_pydict;
+ return PyArg_ParseTuple(args, "|O!:__deepcopy__", &PyDict_Type, &dummy_pydict) != 0;
+}
#ifndef MATH_STANDALONE
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index fe7a046d99c..10419ce71d4 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -106,6 +106,7 @@ bool PyC_RunString_AsString(const char *expr, const char *filename, char **r_val
int PyC_ParseBool(PyObject *o, void *p);
+int PyC_CheckArgs_DeepCopy(PyObject *args);
/* Integer parsing (with overflow checks), -1 on error. */
int PyC_Long_AsBool(PyObject *value);