diff options
author | Christian Heimes <christian@cheimes.de> | 2013-11-22 15:20:53 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-11-22 15:20:53 (GMT) |
commit | 5398e1a56e4483a16e4620758aad0d91e986653f (patch) | |
tree | 6aea394dbdd81213ff99db8c299b36fcf75f72e3 /Modules/_ssl.c | |
parent | c2d65e1e9349179e10b3231820ef57ae136fdd65 (diff) | |
download | cpython-5398e1a56e4483a16e4620758aad0d91e986653f.zip cpython-5398e1a56e4483a16e4620758aad0d91e986653f.tar.gz cpython-5398e1a56e4483a16e4620758aad0d91e986653f.tar.bz2 |
Issue #19448: report name / NID in exception message of ASN1Object
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r-- | Modules/_ssl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index f32d180..180355b 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -3387,7 +3387,7 @@ PySSL_txt2obj(PyObject *self, PyObject *args, PyObject *kwds) } obj = OBJ_txt2obj(txt, name ? 0 : 1); if (obj == NULL) { - PyErr_Format(PyExc_ValueError, "Unknown object"); + PyErr_Format(PyExc_ValueError, "unknown object '%.100s'", txt); return NULL; } result = asn1obj2py(obj); @@ -3411,12 +3411,12 @@ PySSL_nid2obj(PyObject *self, PyObject *args) return NULL; } if (nid < NID_undef) { - PyErr_Format(PyExc_ValueError, "NID must be positive."); + PyErr_SetString(PyExc_ValueError, "NID must be positive."); return NULL; } obj = OBJ_nid2obj(nid); if (obj == NULL) { - PyErr_Format(PyExc_ValueError, "Unknown NID"); + PyErr_Format(PyExc_ValueError, "unknown NID %i", nid); return NULL; } result = asn1obj2py(obj); |