From 5e916c2790ca8f95018f4ca71a1b99d22f858db4 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sat, 14 May 2011 18:47:12 -0700 Subject: [PATCH] Automatically run 2to3 when installing on python 3 --- setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.py b/setup.py index 353788b8..3e1ccdc3 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,8 @@ try: except ImportError: pass +kwargs = {} + # Build the epoll extension for Linux systems with Python < 2.6 extensions = [] major, minor = sys.version_info[:2] @@ -33,6 +35,10 @@ if "linux" in sys.platform.lower() and not python_26: version = "1.2.1" +if major >= 3: + import setuptools # setuptools is required for use_2to3 + kwargs["use_2to3"] = True + distutils.core.setup( name="tornado", version=version, @@ -48,4 +54,5 @@ distutils.core.setup( download_url="http://github.com/downloads/facebook/tornado/tornado-%s.tar.gz" % version, license="http://www.apache.org/licenses/LICENSE-2.0", description="Tornado is an open source version of the scalable, non-blocking web server and and tools that power FriendFeed", + **kwargs )