diff options
author | zverevgeny <zverevgeny@yandex-team.com> | 2025-05-13 19:00:02 +0300 |
---|---|---|
committer | zverevgeny <zverevgeny@yandex-team.com> | 2025-05-13 19:13:54 +0300 |
commit | 92e06374736aa28637dc0e706455b65c8268a5e6 (patch) | |
tree | 3df370c199ae25d308e542f02af20f43eab78f8a /contrib/python/matplotlib/py2/src/mplutils.cpp | |
parent | dc63d5794da99c2ebe3f32914d0351d9707660b0 (diff) | |
download | ydb-92e06374736aa28637dc0e706455b65c8268a5e6.tar.gz |
Import matplotlib
commit_hash:d59c2338025ef8fd1e1f961ed9d8d5fd52d0bd96
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; +} |