[Checkins] SVN: zope.interface/branches/regebro-python3/setup.py extract 2to3 bit into own try/except so it does not trigger "no setuptools" behaviour if actually it only is "no distribute"

Wolfgang Schnerring wosc at wosc.de
Sun Sep 13 07:01:26 EDT 2009


Log message for revision 103900:
  extract 2to3 bit into own try/except so it does not trigger "no setuptools" behaviour if actually it only is "no distribute"
  

Changed:
  U   zope.interface/branches/regebro-python3/setup.py

-=-
Modified: zope.interface/branches/regebro-python3/setup.py
===================================================================
--- zope.interface/branches/regebro-python3/setup.py	2009-09-13 10:47:42 UTC (rev 103899)
+++ zope.interface/branches/regebro-python3/setup.py	2009-09-13 11:01:26 UTC (rev 103900)
@@ -31,13 +31,6 @@
     from setuptools.command.build_ext import build_ext
     import setuptools
 
-    setuptools.run_2to3 = True
-    from setuptools import lib2to3_fixer_packages
-    # this is a bit kludgy since our fixers live inside ourselves,
-    # which we can't import since 2to3 has not been run yet
-    sys.path.append(os.path.join('src', 'zope', 'interface'))
-    lib2to3_fixer_packages.append('fixers')
-
 except ImportError:
     # do we need to support plain distutils for building when even
     # the package itself requires setuptools for installing?
@@ -75,6 +68,22 @@
         features = {'codeoptimization': codeoptimization}
         )
 
+
+try:
+    from setuptools import lib2to3_fixer_packages
+    setuptools.run_2to3 = True
+    # this is a bit kludgy since our fixers live inside ourselves,
+    # which we can't import since 2to3 has not been run yet
+    sys.path.append(os.path.join('src', 'zope', 'interface'))
+    lib2to3_fixer_packages.append('fixers')
+
+    #extra['convert_doctest_2to3'] = XXX
+except ImportError:
+    # either no setuptools or this setuptools is not distribute,
+    # 2to3 support will not be enabled
+    pass
+
+
 def read(*rnames):
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 



More information about the checkins mailing list