mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #4072: Restore build_py_2to3. Add a distutils demo for
build_py_2to3.
This commit is contained in:
parent
aa3066925a
commit
33b6450d23
6 changed files with 52 additions and 12 deletions
3
Demo/distutils/test2to3/README
Normal file
3
Demo/distutils/test2to3/README
Normal 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.
|
18
Demo/distutils/test2to3/setup.py
Normal file
18
Demo/distutils/test2to3/setup.py
Normal 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}
|
||||
)
|
1
Demo/distutils/test2to3/test2to3/__init__.py
Normal file
1
Demo/distutils/test2to3/test2to3/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
# empty
|
5
Demo/distutils/test2to3/test2to3/hello.py
Normal file
5
Demo/distutils/test2to3/test2to3/hello.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
def hello():
|
||||
try:
|
||||
print "Hello, world"
|
||||
except IOError, e:
|
||||
print e.errno
|
Loading…
Add table
Add a link
Reference in a new issue