diff Python/random.c @ 85420:ef889c3d5dc6

Issue #18571: Implementation of the PEP 446: file descriptors and file handles are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
author Victor Stinner <victor.stinner@gmail.com>
date Wed, 28 Aug 2013 00:53:59 +0200
parents fe949918616c
children acc7439b1406
line wrap: on
line diff
--- a/Python/random.c	Tue Aug 27 20:17:03 2013 +0300
+++ b/Python/random.c	Wed Aug 28 00:53:59 2013 +0200
@@ -101,7 +101,7 @@
 
     assert (0 < size);
 
-    fd = open("/dev/urandom", O_RDONLY);
+    fd = _Py_open("/dev/urandom", O_RDONLY);
     if (fd < 0)
         Py_FatalError("Failed to open /dev/urandom");
 
@@ -134,7 +134,7 @@
         return 0;
 
     Py_BEGIN_ALLOW_THREADS
-    fd = open("/dev/urandom", O_RDONLY);
+    fd = _Py_open("/dev/urandom", O_RDONLY);
     Py_END_ALLOW_THREADS
     if (fd < 0)
     {