Permalink
Browse files

Fix to signature definition of PyErr_NewExceptionWithDoc so module ca…

…n work with PyPy
  • Loading branch information...
1 parent 063e33a commit 74836911ccac929c437a260568bfc3cab1f6077b @omwah omwah committed with Jul 14, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 backports/lzma/_lzmamodule.c
@@ -17,8 +17,8 @@
#include "pyerrors.h"
#ifndef PyErr_NewExceptionWithDoc
-/* Python 2.7 and 3.2 added this. */
-#if PY_MAJOR_VERSION >= 3
+/* Python 2.7 and 3.2 added this. PyPy also uses const version of function. */
+#if (PY_MAJOR_VERSION >= 3 || (defined PYPY_VERSION && PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7 && PY_MICRO_VERSION >= 1))
/* Copied from Python-3.2.3/Python/errors.c */
PyObject *
PyErr_NewExceptionWithDoc(const char *name, const char *doc,

0 comments on commit 7483691

Please sign in to comment.