Issue #4072: Restore build_py_2to3. Add a distutils demo for

build_py_2to3.
This commit is contained in:
Martin v. Löwis 2008-10-15 05:58:17 +00:00
parent aa3066925a
commit 33b6450d23
6 changed files with 52 additions and 12 deletions

View file

@ -0,0 +1,3 @@
This project demonstrates how a distutils package
can support Python 2.x and Python 3.x from a single
source, using lib2to3.

View file

@ -0,0 +1,18 @@
# -*- coding: iso-8859-1 -*-
from distutils.core import setup
try:
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
from distutils.command.build_py import build_py
setup(
name = "test2to3",
version = "1.0",
description = "2to3 distutils test package",
author = "Martin v. Löwis",
author_email = "python-dev@python.org",
license = "PSF license",
packages = ["test2to3"],
cmdclass = {'build_py':build_py}
)

View file

@ -0,0 +1 @@
# empty

View file

@ -0,0 +1,5 @@
def hello():
try:
print "Hello, world"
except IOError, e:
print e.errno