[Python-checkins] CVS: distutils/distutils core.py,1.31,1.32
Greg Ward
python-dev@python.org
2000年4月21日 23:20:53 -0400 (EDT)
Update of /projects/cvsroot/distutils/distutils
In directory thrak:/home/gward/python/distutils/distutils
Modified Files:
core.py
Log Message:
Merged in code from the 0.1.5 release to handle IOError and OSError
exceptions better.
Index: core.py
===================================================================
RCS file: /projects/cvsroot/distutils/distutils/core.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** core.py 2000年04月22日 03:11:17 1.31
--- core.py 2000年04月22日 03:20:49 1.32
***************
*** 8,14 ****
# created 1999年03月01日, Greg Ward
! __revision__ = "$Id: core.py,v 1.31 2000年04月22日 03:11:17 gward Exp $"
! import sys
from types import *
from distutils.errors import *
--- 8,14 ----
# created 1999年03月01日, Greg Ward
! __revision__ = "$Id: core.py,v 1.32 2000年04月22日 03:20:49 gward Exp $"
! import sys, os
from types import *
from distutils.errors import *
***************
*** 90,100 ****
except KeyboardInterrupt:
raise SystemExit, "interrupted"
! except (OSError, IOError), exc:
! # arg, try to work with Python pre-1.5.2
if hasattr (exc, 'filename') and hasattr (exc, 'strerror'):
! raise SystemExit, \
! "error: %s: %s" % (exc.filename, exc.strerror)
else:
! raise SystemExit, str (exc)
except (DistutilsExecError,
DistutilsFileError,
--- 90,106 ----
except KeyboardInterrupt:
raise SystemExit, "interrupted"
! except (IOError, os.error), exc:
! # check for Python 1.5.2-style {IO,OS}Error exception objects
if hasattr (exc, 'filename') and hasattr (exc, 'strerror'):
! if exc.filename:
! raise SystemExit, \
! "error: %s: %s" % (exc.filename, exc.strerror)
! else:
! # two-argument functions in posix module don't
! # include the filename in the exception object!
! raise SystemExit, \
! "error: %s" % exc.strerror
else:
! raise SystemExit, "error: " + exc[-1]
except (DistutilsExecError,
DistutilsFileError,