008-distutils-sysconfig-use-sysconfigdata.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Index: b/Lib/distutils/sysconfig.py
  2. ===================================================================
  3. --- a/Lib/distutils/sysconfig.py
  4. +++ b/Lib/distutils/sysconfig.py
  5. @@ -423,40 +423,11 @@
  6. _config_vars = None
  7. def _init_posix():
  8. - """Initialize the module as appropriate for POSIX systems."""
  9. - g = {}
  10. - # load the installed Makefile:
  11. - try:
  12. - filename = get_makefile_filename()
  13. - parse_makefile(filename, g)
  14. - except OSError as msg:
  15. - my_msg = "invalid Python installation: unable to open %s" % filename
  16. - if hasattr(msg, "strerror"):
  17. - my_msg = my_msg + " (%s)" % msg.strerror
  18. -
  19. - raise DistutilsPlatformError(my_msg)
  20. -
  21. - # load the installed pyconfig.h:
  22. - try:
  23. - filename = get_config_h_filename()
  24. - with open(filename) as file:
  25. - parse_config_h(file, g)
  26. - except OSError as msg:
  27. - my_msg = "invalid Python installation: unable to open %s" % filename
  28. - if hasattr(msg, "strerror"):
  29. - my_msg = my_msg + " (%s)" % msg.strerror
  30. -
  31. - raise DistutilsPlatformError(my_msg)
  32. -
  33. - # On AIX, there are wrong paths to the linker scripts in the Makefile
  34. - # -- these paths are relative to the Python source, but when installed
  35. - # the scripts are in another directory.
  36. - if python_build:
  37. - g['LDSHARED'] = g['BLDSHARED']
  38. -
  39. + # _sysconfigdata is generated at build time, see the sysconfig module
  40. + from _sysconfigdata import build_time_vars
  41. global _config_vars
  42. - _config_vars = g
  43. -
  44. + _config_vars = {}
  45. + _config_vars.update(build_time_vars)
  46. def _init_nt():
  47. """Initialize the module as appropriate for NT"""