bitprophet/ssh — Issue #7: Compatibility with Python 3
Author: ramon-garcia
Created: 2012-02-08 15:06:01+00:00
State: open

Hello, I am porting this library to Python 3. Some tests still fail.

The recommended way to have the same code for Python 2 and 3 is to convert 2to3 at build time. Add to setup.py:

try
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
# 2.x
from distutils.command.build_py import build_py
...
setup(...
cmdclass = {'build_py':build_py}
)

This is the approach used by pycrypto, and the one recommended in python.org: http://wiki.python.org/moin/PortingPythonToPy3k

Then, few changes to the source must be still made.