python2/00171-raise-correct-excepti...

15 lines
748 B
Diff

diff -up Python-2.7.3/Misc/NEWS.raise-correct-exception-when-dev-urandom-is-missing Python-2.7.3/Misc/NEWS
diff -up Python-2.7.3/Python/random.c.raise-correct-exception-when-dev-urandom-is-missing Python-2.7.3/Python/random.c
--- Python-2.7.3/Python/random.c.raise-correct-exception-when-dev-urandom-is-missing 2012-04-09 19:07:35.000000000 -0400
+++ Python-2.7.3/Python/random.c 2013-02-21 14:39:01.020988043 -0500
@@ -165,7 +165,8 @@ dev_urandom_python(char *buffer, Py_ssiz
Py_END_ALLOW_THREADS
if (fd < 0)
{
- PyErr_SetFromErrnoWithFilename(PyExc_OSError, "/dev/urandom");
+ PyErr_SetString(PyExc_NotImplementedError,
+ "/dev/urandom (or equivalent) not found");
return -1;
}