[Python-checkins] cpython (2.7): Issue #23115: Fixed compilation on OpenBSD (Py_MIN is not defined in 2.7).

serhiy.storchaka python-checkins at python.org
Mon Feb 16 07:13:56 CET 2015


https://hg.python.org/cpython/rev/a1391786abcd
changeset:   94647:a1391786abcd
branch:      2.7
parent:      94642:13ffc5ea7fe8
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Feb 16 08:05:10 2015 +0200
summary:
  Issue #23115: Fixed compilation on OpenBSD (Py_MIN is not defined in 2.7).

files:
  Python/random.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Python/random.c b/Python/random.c
--- a/Python/random.c
+++ b/Python/random.c
@@ -102,7 +102,7 @@
 py_getentropy(unsigned char *buffer, Py_ssize_t size, int fatal)
 {
     while (size > 0) {
-        Py_ssize_t len = Py_MIN(size, 256);
+        Py_ssize_t len = size < 256 ? size : 256;
         int res = getentropy(buffer, len);
         if (res < 0) {
             if (fatal) {

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list