diff options
author | Joseph Gilbert <ascotan@gmail.com> | 2005-11-08 19:27:58 +0300 |
---|---|---|
committer | Joseph Gilbert <ascotan@gmail.com> | 2005-11-08 19:27:58 +0300 |
commit | cd7ca03034dd9a1d1ca2c9159da245605ddce597 (patch) | |
tree | 8a710123377b1c46ea69f5241989726b7c5751ee /source/blender/python/api2_2x/constant.c | |
parent | bcd723c0af69db905b2850db24ea88a696acac9f (diff) |
*work around for PyDict_Contains
Diffstat (limited to 'source/blender/python/api2_2x/constant.c')
-rw-r--r-- | source/blender/python/api2_2x/constant.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/constant.c b/source/blender/python/api2_2x/constant.c index cf499a89921..f131a169089 100644 --- a/source/blender/python/api2_2x/constant.c +++ b/source/blender/python/api2_2x/constant.c @@ -136,13 +136,14 @@ static PyObject *constant_getAttr(BPy_constant * self, char *name) static PyObject *constant_repr(BPy_constant * self) { char buffer[128], str[4096]; - PyObject *key, *value; + PyObject *key, *value, *keys; int pos = 0; BLI_strncpy(str,"",4096); sprintf(buffer, "[Constant: "); strcat(str,buffer); - if (PyDict_Contains(self->dict, PyString_FromString("name"))){ + keys = PyDict_Keys(self->dict); + if (PySequence_Contains(keys, PyString_FromString("name"))){ value = PyDict_GetItemString(self->dict, "name"); sprintf(buffer, "%s", PyString_AsString(value)); strcat(str,buffer); |