Brandt Bucher <brandtbuc...@gmail.com> added the comment:
How do others feel about the creation of a new private API? It would keep these diffs smaller and ease refactoring... and it would probably be good to have around anyways: /* Like PyModule_AddObject, but steals o on success AND failure. */ int _PyModule_StealObject(PyObject *m, const char *name, PyObject *o) { if (PyModule_AddObject(m, name, o) < 0) { Py_XDECREF(o); return -1; } return 0; } ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38823> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com