From: Benjamin Peterson Date: Thu, 21 Aug 2014 02:37:01 +0000 (-0500) Subject: fix error message for invalid curve name X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ed3e29723cad990e41114954692fb50e682ac86;p=python fix error message for invalid curve name --- diff --git a/Modules/_ssl.c b/Modules/_ssl.c index ed4bbfd6d3..5518032b26 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2855,8 +2855,12 @@ set_ecdh_curve(PySSLContext *self, PyObject *name) } nid = OBJ_sn2nid(name_bytes); if (nid == 0) { + PyObject *r = PyObject_Repr(name); + if (!r) + return NULL; PyErr_Format(PyExc_ValueError, - "unknown elliptic curve name %R", name); + "unknown elliptic curve name %s", PyString_AS_STRING(r)); + Py_DECREF(r); return NULL; } key = EC_KEY_new_by_curve_name(nid);