[Python-checkins] python/dist/src/Modules _iconv_codec.c,1.13,1.14

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
Fri, 28 Feb 2003 09:21:42 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv13513/Modules

Modified Files:
	_iconv_codec.c 
Log Message:
Fix SF bug #690012 (among others), iconv_codec stops build

Change setup.py to catch all exceptions.
  - Rename module if the exception was an ImportError
  - Only warn if the exception was any other error

Revert _iconv_codec to raising a RuntimeError.


Index: _iconv_codec.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_iconv_codec.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** _iconv_codec.c	24 Feb 2003 20:17:32 -0000	1.13
--- _iconv_codec.c	28 Feb 2003 17:21:39 -0000	1.14
***************
*** 675,679 ****
  
      if (hdl == (iconv_t)-1) {
!         PyErr_SetString(PyExc_ImportError,
  	  "can't initialize the _iconv_codec module: iconv_open() failed");
  	return;
--- 675,679 ----
  
      if (hdl == (iconv_t)-1) {
!         PyErr_SetString(PyExc_RuntimeError,
  	  "can't initialize the _iconv_codec module: iconv_open() failed");
  	return;
***************
*** 682,686 ****
      res = iconv(hdl, &inptr, &insize, &outptr, &outsize);
      if (res == (size_t)-1) {
!         PyErr_SetString(PyExc_ImportError,
  	  "can't initialize the _iconv_codec module: iconv() failed");
  	return;
--- 682,686 ----
      res = iconv(hdl, &inptr, &insize, &outptr, &outsize);
      if (res == (size_t)-1) {
!         PyErr_SetString(PyExc_RuntimeError,
  	  "can't initialize the _iconv_codec module: iconv() failed");
  	return;
***************
*** 699,703 ****
      else {
  	iconv_close(hdl);
!         PyErr_SetString(PyExc_ImportError,
  	  "can't initialize the _iconv_codec module: mixed endianess");
  	return;
--- 699,703 ----
      else {
  	iconv_close(hdl);
!         PyErr_SetString(PyExc_RuntimeError,
  	  "can't initialize the _iconv_codec module: mixed endianess");
  	return;