]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Broaden catch clause in extension building.
authorBen Darnell <ben@bendarnell.com>
Sat, 7 Jun 2014 15:08:52 +0000 (11:08 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 7 Jun 2014 15:08:52 +0000 (11:08 -0400)
This should allow Tornado to be installed again on OSX with no
compiler available.

Closes #1074.

setup.py

index f888fdcee44637c9117e3cab377f94f5d22837b3..0a35d612be120c0055e146527f3d91ce3390b65a 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -83,7 +83,7 @@ http://api.mongodb.org/python/current/installation.html#osx
     def run(self):
         try:
             build_ext.run(self)
-        except DistutilsPlatformError:
+        except build_errors:
             e = sys.exc_info()[1]
             sys.stdout.write('%s\n' % str(e))
             warnings.warn(self.warning_message % ("Extension modules",
@@ -93,24 +93,17 @@ http://api.mongodb.org/python/current/installation.html#osx
 
     def build_extension(self, ext):
         name = ext.name
-        if sys.version_info[:3] >= (2, 4, 0):
-            try:
-                build_ext.build_extension(self, ext)
-            except build_errors:
-                e = sys.exc_info()[1]
-                sys.stdout.write('%s\n' % str(e))
-                warnings.warn(self.warning_message % ("The %s extension "
-                                                      "module" % (name,),
-                                                      "The output above "
-                                                      "this warning shows how "
-                                                      "the compilation "
-                                                      "failed."))
-        else:
+        try:
+            build_ext.build_extension(self, ext)
+        except build_errors:
+            e = sys.exc_info()[1]
+            sys.stdout.write('%s\n' % str(e))
             warnings.warn(self.warning_message % ("The %s extension "
                                                   "module" % (name,),
-                                                  "Please use Python >= 2.4 "
-                                                  "to take advantage of the "
-                                                  "extension."))
+                                                  "The output above "
+                                                  "this warning shows how "
+                                                  "the compilation "
+                                                  "failed."))
 
 
 kwargs = {}