Source

lib3to2 / python2.patch

Full commit
--- setup.py	2010-05-24 19:46:36.000000000 -0400
+++ setup.py	2010-05-25 14:51:00.000000000 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3.1
+#!/usr/bin/env python2.7
 
 classifiers = [
 "Development Status :: 4 - Beta",
@@ -6,8 +6,7 @@
 "Intended Audience :: Developers",
 "License :: OSI Approved :: Apache Software License",
 "Operating System :: OS Independent",
-"Programming Language :: Python :: 3",
-"Programming Language :: Python :: 3.1",
+"Programming Language :: Python :: 2.7",
 "Topic :: Software Development :: Code Generators",
 "Topic :: Software Development :: Libraries :: Python Modules",
 ]
@@ -14,7 +14,7 @@
 from distutils.core import setup
 
 setup(
-   name="3to2_py3k",
+   name="3to2",
    packages=["lib3to2","lib3to2.fixes","lib3to2.tests"],
    scripts=["3to2"],
    version="0.1",

--- 3to2	2010-05-24 19:45:12.000000000 -0400
+++ 3to2	2010-05-24 19:49:01.000000000 -0400
@@ -1,6 +1,12 @@
-#!/usr/bin/env python3.1
+#!/usr/bin/env python2.7
 import sys
 
+print ("Checking Python version info..."),
+if sys.version_info < (2, 7) or sys.version_info >= (3, 0):
+    sys.exit("ERROR: 3to2 requires at least Python 2.7 in the 2.x branch.")
+else:
+    print ("%d.%d.%d" % (sys.version_info[:3]))
+
 from lib3to2.main import main
 
 sys.exit(main("lib3to2.fixes"))

--- Makefile	2010-05-25 15:27:04.000000000 -0400
+++ Makefile	2010-05-25 15:32:09.000000000 -0400
@@ -1,4 +1,4 @@
-PYVERSION = python3.1
+PYVERSION = python2.7
 SETUP = ./setup.py
 FIND = find
 

--- lib3to2/tests/test_all_fixers.py	2010-05-24 19:45:12.000000000 -0400
+++ lib3to2/tests/test_all_fixers.py	2010-05-25 15:34:10.000000000 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3.1
+#!/usr/bin/env python2.7
 """
 Runs all tests in the same directory named test_*.py
 """