Skip to content

Commit 006cac4

Browse files
committed
Python 3.2.3 defines some calls as macros, coded around this
1 parent 75e18d4 commit 006cac4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

hardware/plugins/DelayedLink.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ namespace Plugins {
169169
#define PyObject_GetAttrString pythonLib->PyObject_GetAttrString
170170
#define PyObject_HasAttrString pythonLib->PyObject_HasAttrString
171171
#define PyBytes_AsString pythonLib->PyBytes_AsString
172-
//#define PyUnicode_AsASCIIString pythonLib->PyUnicode_AsASCIIString
172+
// Python 3.2.3 has defined these as macros so we can't redefine them here
173+
//#define PyUnicode_AsASCIIString pythonLib->PyUnicode_AsASCIIString
173174
//#define PyUnicode_FromString pythonLib->PyUnicode_FromString
174-
#define PyUnicode_FromFormat pythonLib->PyUnicode_FromFormat
175+
//#define PyUnicode_FromFormat pythonLib->PyUnicode_FromFormat
175176
#define PyLong_FromLong pythonLib->PyLong_FromLong
176177
#define PyLong_AsLongLong pythonLib->PyLong_AsLongLong
177178
#define PyModule_GetDict pythonLib->PyModule_GetDict

hardware/plugins/PluginManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ namespace Plugins {
794794
{
795795
PyObject* pNameBytes = pythonLib->PyUnicode_AsASCIIString(self->Name);
796796
PyObject* pValueBytes = pythonLib->PyUnicode_AsASCIIString(self->sValue);
797-
PyObject* pRetVal = PyUnicode_FromFormat("ID: %d, Name: '%s', nValue: %d, sValue: '%s'", self->ID, PyBytes_AsString(pNameBytes), self->nValue, PyBytes_AsString(pValueBytes));
797+
PyObject* pRetVal = pythonLib->PyUnicode_FromFormat("ID: %d, Name: '%s', nValue: %d, sValue: '%s'", self->ID, PyBytes_AsString(pNameBytes), self->nValue, PyBytes_AsString(pValueBytes));
798798
Py_DECREF(pNameBytes);
799799
Py_DECREF(pValueBytes);
800800
return pRetVal;

0 commit comments

Comments
 (0)