Skip to content

Commit d29be04

Browse files
committed
replace PyCreateDummyObject usages with PyModule_New
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
1 parent c1e269a commit d29be04

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

src/constants.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
292292
#undef PYXMLSEC_ADD_INT_CONSTANT
293293

294294
#define PYXMLSEC_DECLARE_NAMESPACE(var, name) \
295-
if (!(var = PyCreateDummyObject(name))) goto ON_FAIL; \
295+
if (!(var = PyModule_New(name))) goto ON_FAIL; \
296296
if (PyModule_AddObject(package, name, var) < 0) goto ON_FAIL; \
297297
Py_INCREF(var); // add object steels reference
298298

src/platform.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,11 @@ typedef int Py_ssize_t;
3838
#if PY_MAJOR_VERSION >= 3
3939
#define PY3K 1
4040

41-
#define PyCreateDummyObject PyModule_New
42-
4341
#define PyString_FSConverter PyUnicode_FSConverter
4442
#else // PY3K
4543

4644
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
4745

48-
static inline PyObject* PyCreateDummyObject(const char* name) {
49-
PyObject* tmp = Py_InitModule(name, NULL);
50-
Py_INCREF(tmp);
51-
return tmp;
52-
}
53-
5446
static inline int PyString_FSConverter(PyObject* o, PyObject** p) {
5547
if (o == NULL) {
5648
return 0;

0 commit comments

Comments
 (0)