summaryrefslogtreecommitdiffstats
path: root/Modules/_iconv_codec.c
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2003-02-24 20:17:32 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2003-02-24 20:17:32 (GMT)
commitdd8766a65bed9b86f9309f9b743b5d0f1074779e (patch)
treef0ffd050dd6a227958ae73096a1b0d79c91b8897 /Modules/_iconv_codec.c
parent0f69833396cfc912e4c6931154d3abaee941b4f1 (diff)
downloadcpython-dd8766a65bed9b86f9309f9b743b5d0f1074779e.zip
cpython-dd8766a65bed9b86f9309f9b743b5d0f1074779e.tar.gz
cpython-dd8766a65bed9b86f9309f9b743b5d0f1074779e.tar.bz2
Change the test encoding from "ISO8859-1" to "ISO-8859-1"
(see SF bug #690309) and raise ImportErrors instead of RuntimeErrors, so building Python continues even if importing iconv_codecs fails. This is a temporary fix until we get proper configure support for "broken" iconv implementations.
Diffstat (limited to 'Modules/_iconv_codec.c')
-rw-r--r--Modules/_iconv_codec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_iconv_codec.c b/Modules/_iconv_codec.c
index 1d2e5d4..a26a341 100644
--- a/Modules/_iconv_codec.c
+++ b/Modules/_iconv_codec.c
@@ -671,17 +671,17 @@ init_iconv_codec(void)
size_t outsize = sizeof(out);
size_t res;
- iconv_t hdl = iconv_open(UNICODE_ENCODING, "ISO8859-1");
+ iconv_t hdl = iconv_open(UNICODE_ENCODING, "ISO-8859-1");
if (hdl == (iconv_t)-1) {
- PyErr_SetString(PyExc_RuntimeError,
+ PyErr_SetString(PyExc_ImportError,
"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_RuntimeError,
+ PyErr_SetString(PyExc_ImportError,
"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_RuntimeError,
+ PyErr_SetString(PyExc_ImportError,
"can't initialize the _iconv_codec module: mixed endianess");
return;
}