Is it worth back porting PEP 3147 to Python < 3.2?

Julian Andres Klode jak at
Tue Apr 20 06:47:18 BST 2010

On Tue, Apr 20, 2010 at 06:50:26AM +0300, Omer Zak wrote:
> My take of the situation:
> Yes, please backport PEP 3147 to at least Python 2.7.
> The rationale: we'll need to support both Python 2.x and Python 3.x for
> several years, and it will be nice if the same library package can be
> made to support both 2.x and 3.x.
> It would also be nice to define a way to specify that a tree of Python
> 2.7 scripts are to be compiled into Python 3.x bytecode, by specifying
> that the compilation process has first to run 2to3
> ( on the
> Python scripts and actually compile the 2to3's output.

Use build_py_2to3 from distutils.command.build_py, for example:

    if sys.version_info[0] == 3:
        from distutils.command.build_py import build_py_2to3
        cmdclass['build_py'] = build_py_2to3

Julian Andres Klode  - Debian Developer, Ubuntu Member

See and
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : 

More information about the ubuntu-devel mailing list