summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-02-28 17:21:39 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-02-28 17:21:39 (GMT)
commit3f5fcc8acce9fa620fe29d15980850e433f1d5c9 (patch)
treec0e81780a6516e2b6935b7b4df29d6b0e9c7b95c /Modules
parentedaa071eb45cecbcf4d74b886bfac1ac2a780916 (diff)
downloadcpython-3f5fcc8acce9fa620fe29d15980850e433f1d5c9.zip
cpython-3f5fcc8acce9fa620fe29d15980850e433f1d5c9.tar.gz
cpython-3f5fcc8acce9fa620fe29d15980850e433f1d5c9.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_iconv_codec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_iconv_codec.c b/Modules/_iconv_codec.c
index a26a341..3570f46 100644
--- a/Modules/_iconv_codec.c
+++ b/Modules/_iconv_codec.c
@@ -674,14 +674,14 @@ init_iconv_codec(void)
iconv_t hdl = iconv_open(UNICODE_ENCODING, "ISO-8859-1");
if (hdl == (iconv_t)-1) {
- PyErr_SetString(PyExc_ImportError,
+ PyErr_SetString(PyExc_RuntimeError,
"can't initialize the _iconv_codec module: iconv_open() failed");
return;
}
res = iconv(hdl, &inptr, &insize, &outptr, &outsize);
if (res == (size_t)-1) {
- PyErr_SetString(PyExc_ImportError,
+ PyErr_SetString(PyExc_RuntimeError,
"can't initialize the _iconv_codec module: iconv() failed");
return;
}
@@ -698,7 +698,7 @@ init_iconv_codec(void)
byteswap = 1;
else {
iconv_close(hdl);
- PyErr_SetString(PyExc_ImportError,
+ PyErr_SetString(PyExc_RuntimeError,
"can't initialize the _iconv_codec module: mixed endianess");
return;
}