Commits

tarek  committed a5fa911

Python 2.7 compat

  • Participants
  • Parent commits f6e46b7
  • Branches 0.6-maintenance

Comments (0)

Files changed (3)

File docs/setuptools.txt

     below on `Automatic Resource Extraction`_.
 
 ``use_2to3``
-    Convert the source code from Python 2 to Python 3 with 2to3 during the 
+    Convert the source code from Python 2 to Python 3 with 2to3 during the
     build process. See :doc:`python3` for more details.
 
 ``convert_2to3_doctests``
-    List of doctest source files that need to be converted with 2to3. 
+    List of doctest source files that need to be converted with 2to3.
     See :doc:`python3` for more details.
-    
+
 ``use_2to3_fixers``
     A list of modules to search for additional fixers to be used during
     the 2to3 conversion. See :doc:`python3` for more details.
    C-based module, instead of getting a ``NameError``).
 
 0.6c7
- * Fixed ``distutils.filelist.findall()`` crashing on broken symlinks, and 
+ * Fixed ``distutils.filelist.findall()`` crashing on broken symlinks, and
    ``egg_info`` command failing on new, uncommitted SVN directories.
 
  * Fix import problems with nested namespace packages installed via
 
  * Fix ``find_packages()`` treating ``ez_setup`` and directories with ``.`` in
    their names as packages.
- 
+
 0.6c5
  * Fix uploaded ``bdist_rpm`` packages being described as ``bdist_egg``
    packages under Python versions less than 2.5.

File pkg_resources.py

     XXX Currently this is the same as ``distutils.util.get_platform()``, but it
     needs some hacks for Linux and Mac OS X.
     """
-    from distutils.util import get_platform
+    try:
+        from distutils.util import get_platform
+    except ImportError:
+        from sysconfig import get_platform
+
     plat = get_platform()
     if sys.platform == "darwin" and not plat.startswith('macosx-'):
         try:

File setuptools/command/bdist_egg.py

 import sys, os, marshal
 from setuptools import Command
 from distutils.dir_util import remove_tree, mkpath
-from distutils.sysconfig import get_python_version, get_python_lib
+try:
+    from distutils.sysconfig import get_python_version, get_python_lib
+except ImportError:
+    from sysconfig import get_python_version
+    from distutils.sysconfig import get_python_lib
+
 from distutils import log
 from distutils.errors import DistutilsSetupError
 from pkg_resources import get_build_platform, Distribution, ensure_directory