From: Ben Darnell Date: Sun, 15 May 2011 01:47:12 +0000 (-0700) Subject: Automatically run 2to3 when installing on python 3 X-Git-Tag: v2.0.0~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e916c2790ca8f95018f4ca71a1b99d22f858db4;p=thirdparty%2Ftornado.git Automatically run 2to3 when installing on python 3 --- diff --git a/setup.py b/setup.py index 353788b8f..3e1ccdc34 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 )