Skip to content

Commit a86b6b4

Browse files
committed
Ensure we can work with Python 3 ... again
The C extension API has changed in some key places. This commit fixes one compatibility error.
1 parent c81c824 commit a86b6b4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

softIocApp/PythonSupport.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const char *get_EPICS_BASE(void)
1616
}
1717

1818

19+
/* In Python3 this function has been renamed. */
20+
#if PY_MAJOR_VERSION >= 3
21+
#define PyInt_FromLong(value) PyLong_FromLong(value)
22+
#endif
23+
1924
/* Helper for function below. */
2025
#define ADD_ENUM(dict, name) \
2126
PyDict_SetItemString(dict, #name, PyInt_FromLong(name))

0 commit comments

Comments
 (0)