In this commit, you'll find all the stuffs I had to do to be compliant at the same time with the C Python 3 API and the C Python 2 API, but without using a "#if PY_MAJOR_VERSION == 3" hack. This means:
Add parenthesis to Python code (test and Makefile.PL)
Change mixed space/tab in Python code with spaces only
Remove DL_EXPORT/DL_IMPORT Macro (deprecated since Py2.3)
Use Macro Py_TYPE, Py_REFCNT and PyVarObject_HEAD_INIT. Add "ifndef" since Python 2.5 does not recognize them.
Add __dir__ method to perl package and perl object (dir() is no more looking for __methods__ attribute in Py3)
In addition, few Py_DECREF/Py_XDECREF was missing.
Tested on Ubuntu 14.04 with Python 2.5.6, 2.6.9 and 2.7.6
Hi,
In this commit, you'll find all the stuffs I had to do to be compliant at the same time with the C Python 3 API and the C Python 2 API, but without using a "#if PY_MAJOR_VERSION == 3" hack. This means:
__dir__
method to perl package and perl object (dir()
is no more looking for__methods__
attribute in Py3)In addition, few Py_DECREF/Py_XDECREF was missing.
Tested on Ubuntu 14.04 with Python 2.5.6, 2.6.9 and 2.7.6