Skip to content

Commit 2541024

Browse files
committed
Fixes pygilstate compiler errors for Python < 3.
1 parent 92cf66b commit 2541024

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎Source/UnrealEnginePython/Private/UnrealEnginePython.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ char *PyUnicode_AsUTF8(PyObject *py_str) {
2020
}
2121
return PyString_AsString(py_str);
2222
}
23+
24+
int PyGILState_Check() {
25+
PyThreadState * tstate = _PyThreadState_Current;
26+
return tstate && (tstate == PyGILState_GetThisThreadState());
27+
}
2328
#endif
2429

2530
bool PyUnicodeOrString_Check(PyObject *py_obj) {

‎Source/UnrealEnginePython/Private/UnrealEnginePythonPrivatePCH.h‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@
5050

5151
#if PY_MAJOR_VERSION < 3
5252
char *PyUnicode_AsUTF8(PyObject *py_str);
53-
int PyGILState_Check() {
54-
PyThreadState * tstate = _PyThreadState_Current;
55-
return tstate && (tstate == PyGILState_GetThisThreadState());
56-
}
53+
int PyGILState_Check();
5754
#endif
5855
bool PyUnicodeOrString_Check(PyObject *py_obj);

0 commit comments

Comments
 (0)