Skip to content

Commit 50cb245

Browse files
author
rdeioris
authored
Merge pull request #72 from osstony/pygilstate_check_fix
Fixes pygilstate compiler errors for Python < 3.
2 parents 92cf66b + 2541024 commit 50cb245

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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)