summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-10-15 05:58:17 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-10-15 05:58:17 (GMT)
commit33b6450d23cbe66457e3392b9d187f20d888601c (patch)
treebc4b4c3a1c58f04a8b4b6b6103967a3d8dcc7897 /Demo
parentaa3066925acdd5ff3b709043138b2ff6ef53c5dd (diff)
downloadcpython-33b6450d23cbe66457e3392b9d187f20d888601c.zip
cpython-33b6450d23cbe66457e3392b9d187f20d888601c.tar.gz
cpython-33b6450d23cbe66457e3392b9d187f20d888601c.tar.bz2
Issue #4072: Restore build_py_2to3. Add a distutils demo for
build_py_2to3.
Diffstat (limited to 'Demo')
-rw-r--r--Demo/distutils/test2to3/README3
-rw-r--r--Demo/distutils/test2to3/setup.py18
-rw-r--r--Demo/distutils/test2to3/test2to3/__init__.py1
-rw-r--r--Demo/distutils/test2to3/test2to3/hello.py5
4 files changed, 27 insertions, 0 deletions
diff --git a/Demo/distutils/test2to3/README b/Demo/distutils/test2to3/README
new file mode 100644
index 0000000..9365593
--- /dev/null
+++ b/Demo/distutils/test2to3/README
@@ -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. \ No newline at end of file
diff --git a/Demo/distutils/test2to3/setup.py b/Demo/distutils/test2to3/setup.py
new file mode 100644
index 0000000..3abb5ff
--- /dev/null
+++ b/Demo/distutils/test2to3/setup.py
@@ -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}
+)
diff --git a/Demo/distutils/test2to3/test2to3/__init__.py b/Demo/distutils/test2to3/test2to3/__init__.py
new file mode 100644
index 0000000..1bb8bf6
--- /dev/null
+++ b/Demo/distutils/test2to3/test2to3/__init__.py
@@ -0,0 +1 @@
+# empty
diff --git a/Demo/distutils/test2to3/test2to3/hello.py b/Demo/distutils/test2to3/test2to3/hello.py
new file mode 100644
index 0000000..f52926b
--- /dev/null
+++ b/Demo/distutils/test2to3/test2to3/hello.py
@@ -0,0 +1,5 @@
+def hello():
+ try:
+ print "Hello, world"
+ except IOError, e:
+ print e.errno