[Python-checkins] CVS: distutils/distutils sysconfig.py,1.17,1.18

Greg Ward python-dev@python.org
Tue, 23 May 2000 16:14:03 -0700


Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv22595

Modified Files:
	sysconfig.py 
Log Message:
Catch failure to open installed Makefile, and report it as a
DistutilsPlatformError: "invalid Python installation".  (This will
happen on Red Hat-ish systems where the python-devel package is not
installed.)

Index: sysconfig.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/sysconfig.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** sysconfig.py	2000/04/19 02:22:07	1.17
--- sysconfig.py	2000/05/23 23:14:00	1.18
***************
*** 7,11 ****
  """
  
! __version__ = "$Revision: 1.17 $"
  
  import os
--- 7,11 ----
  """
  
! __version__ = "$Revision: 1.18 $"
  
  import os
***************
*** 230,234 ****
      g = globals()
      # load the installed Makefile:
!     parse_makefile(open(get_makefile_filename()), g)
  
  
--- 230,244 ----
      g = globals()
      # load the installed Makefile:
!     try:
!         filename = get_makefile_filename()
!         file = open(filename)
!     except IOError, msg:
!         my_msg = "invalid Python installation: unable to open %s" % filename
!         if hasattr(msg, "strerror"):
!             my_msg = my_msg + " (%s)" % msg.strerror
! 
!         raise DistutilsPlatformError, my_msg
!               
!     parse_makefile(file, g)