Skip to content

Commit 7e0f289

Browse files
committed
Base: Set swig module if necessary
1 parent d76f592 commit 7e0f289

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/Base/swigpyrun.inl

+12-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ int createSWIGPointerObj_T(const char* TypeName, void* obj, PyObject** ptr, int
2525
{
2626
swig_module_info* module = SWIG_GetModule(nullptr);
2727
if (!module) {
28-
return 1;
28+
SWIG_SetModule(nullptr, module);
29+
if (!module) {
30+
return 1;
31+
}
2932
}
3033

3134
swig_type_info* swig_type = nullptr;
@@ -49,7 +52,10 @@ int convertSWIGPointerObj_T(const char* TypeName, PyObject* obj, void** ptr, int
4952
{
5053
swig_module_info* module = SWIG_GetModule(nullptr);
5154
if (!module) {
52-
return 1;
55+
SWIG_SetModule(nullptr, module);
56+
if (!module) {
57+
return 1;
58+
}
5359
}
5460

5561
swig_type_info* swig_type = nullptr;
@@ -117,7 +123,10 @@ int getSWIGPointerTypeObj_T(const char* TypeName, PyTypeObject** ptr)
117123
{
118124
swig_module_info* module = SWIG_GetModule(nullptr);
119125
if (!module) {
120-
return 1;
126+
SWIG_SetModule(nullptr, module);
127+
if (!module) {
128+
return 1;
129+
}
121130
}
122131

123132
swig_type_info* swig_type = nullptr;

0 commit comments

Comments
 (0)