Fix undefined sumbol in Python 3

`PyInt_FromLong` was renamed to `PyLong_FromLong` in Python 3. A macro
has been added to fix this.
This commit is contained in:
Frank Smit
2012-02-06 16:26:34 +01:00
parent d15e7e6bee
commit bd2ba1f528
2 changed files with 8 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ md = Markdown(BleepRenderer(),
EXT_STRIKETHROUGH | EXT_SUPERSCRIPT)
print(md.render(u'''
print(md.render('''
Unordered
- One

View File

@@ -40,8 +40,14 @@
}
#if PY_MAJOR_VERSION >= 3
#define FromLongToPyLong(i) PyLong_FromLong(i)
#else
#define FromLongToPyLong(i) PyInt_FromLong(i)
#endif
#define PY_STR(b) (b != NULL ? Py_BuildValue("s#", b->data, (int) b->size) : Py_None)
#define PY_INT(i) PyInt_FromLong(i)
#define PY_INT(i) FromLongToPyLong(i)
/* Block level