diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-05-14 00:51:55 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-05-14 00:51:55 +0000 |
commit | b2d03716ee053cd32dccb8dd189d0b4bc3540d90 (patch) | |
tree | d329b3f92d5f80b8a76cac17d9e30bd1c8dc4b06 /contrib/python/matplotlib/py2/src/mplutils.cpp | |
parent | 645c59acc8ced6d89eb8559e26a7405d42ae9fb4 (diff) | |
parent | 0bf9db6399352012396e7791bcfd762e944b33c2 (diff) | |
download | ydb-b2d03716ee053cd32dccb8dd189d0b4bc3540d90.tar.gz |
Merge branch 'rightlib' into merge-libs-250514-0050
Diffstat (limited to 'contrib/python/matplotlib/py2/src/mplutils.cpp')
-rw-r--r-- | contrib/python/matplotlib/py2/src/mplutils.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/python/matplotlib/py2/src/mplutils.cpp b/contrib/python/matplotlib/py2/src/mplutils.cpp new file mode 100644 index 00000000000..bc09db52aa9 --- /dev/null +++ b/contrib/python/matplotlib/py2/src/mplutils.cpp @@ -0,0 +1,21 @@ +/* -*- mode: c++; c-basic-offset: 4 -*- */ + +#include "mplutils.h" + +int add_dict_int(PyObject *dict, const char *key, long val) +{ + PyObject *valobj; + valobj = PyLong_FromLong(val); + if (valobj == NULL) { + return 1; + } + + if (PyDict_SetItemString(dict, (char *)key, valobj)) { + Py_DECREF(valobj); + return 1; + } + + Py_DECREF(valobj); + + return 0; +} |