MCPcopy Create free account
hub / github.com/mhammond/pywin32 / AddConstant

Function AddConstant

com/win32com/src/PythonCOM.cpp:2090–2100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2088};
2089
2090int AddConstant(PyObject *dict, const char *key, long value)
2091{
2092 PyObject *oval = PyInt_FromLong(value);
2093 if (!oval)
2094 {
2095 return 1;
2096 }
2097 int rc = PyDict_SetItemString(dict, (char*)key, oval);
2098 Py_DECREF(oval);
2099 return rc;
2100}
2101
2102#define ADD_CONSTANT(tok) AddConstant(dict, #tok, tok)
2103

Callers 1

PYWIN_MODULE_INIT_FUNCFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected