patch-setup_py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --- Python-2.7.orig/setup.py 2010-06-27 14:36:16.000000000 +0200
  2. +++ Python-2.7/setup.py 2010-11-04 22:25:30.000000000 +0100
  3. @@ -21,7 +21,7 @@ from distutils.spawn import find_executa
  4. COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
  5. # This global variable is used to hold the list of modules to be disabled.
  6. -disabled_module_list = []
  7. +disabled_module_list = ['nis', 'bz2']
  8. def add_dir_to_list(dirlist, dir):
  9. """Add the directory 'dir' to the list 'dirlist' (at the front) if
  10. @@ -307,36 +307,6 @@ class PyBuildExt(build_ext):
  11. ext_filename = os.path.join(
  12. self.build_lib,
  13. self.get_ext_filename(self.get_ext_fullname(ext.name)))
  14. - try:
  15. - imp.load_dynamic(ext.name, ext_filename)
  16. - except ImportError, why:
  17. - self.failed.append(ext.name)
  18. - self.announce('*** WARNING: renaming "%s" since importing it'
  19. - ' failed: %s' % (ext.name, why), level=3)
  20. - assert not self.inplace
  21. - basename, tail = os.path.splitext(ext_filename)
  22. - newname = basename + "_failed" + tail
  23. - if os.path.exists(newname):
  24. - os.remove(newname)
  25. - os.rename(ext_filename, newname)
  26. -
  27. - # XXX -- This relies on a Vile HACK in
  28. - # distutils.command.build_ext.build_extension(). The
  29. - # _built_objects attribute is stored there strictly for
  30. - # use here.
  31. - # If there is a failure, _built_objects may not be there,
  32. - # so catch the AttributeError and move on.
  33. - try:
  34. - for filename in self._built_objects:
  35. - os.remove(filename)
  36. - except AttributeError:
  37. - self.announce('unable to remove files (ignored)')
  38. - except:
  39. - exc_type, why, tb = sys.exc_info()
  40. - self.announce('*** WARNING: importing extension "%s" '
  41. - 'failed with %s: %s' % (ext.name, exc_type, why),
  42. - level=3)
  43. - self.failed.append(ext.name)
  44. def get_platform(self):
  45. # Get value of sys.platform
  46. @@ -347,8 +317,8 @@ class PyBuildExt(build_ext):
  47. def detect_modules(self):
  48. # Ensure that /usr/local is always used
  49. - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  50. - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  51. + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  52. + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  53. # Add paths specified in the environment variables LDFLAGS and
  54. # CPPFLAGS for header and library files.