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;
}
byteswap = 1;
else {
iconv_close(hdl);
- PyErr_SetString(PyExc_ImportError,
+ PyErr_SetString(PyExc_RuntimeError,
"can't initialize the _iconv_codec module: mixed endianess");
return;
}
self.get_ext_filename(self.get_ext_fullname(ext.name)))
try:
imp.load_dynamic(ext.name, ext_filename)
- except ImportError, why:
+ except:
- if 1:
+ exc_type, why, tb = sys.exc_info()
+ if issubclass(exc_type, ImportError):
self.announce('*** WARNING: renaming "%s" since importing it'
' failed: %s' % (ext.name, why), level=3)
assert not self.inplace
self.announce('unable to remove files (ignored)')
else:
self.announce('*** WARNING: importing extension "%s" '
- 'failed: %s' % (ext.name, why), level=3)
+ 'failed with %s: %s' % (ext.name, exc_type, why),
+ level=3)
def get_platform (self):
# Get value of sys.platform