Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r95070:88a9f1bbf1c8
Date: 2018-09-01 15:04 +0200
http://bitbucket.org/pypy/pypy/changeset/88a9f1bbf1c8/

Log:    Issue #2876

        Add select.PIPE_BUF.

diff --git a/pypy/module/select/__init__.py b/pypy/module/select/__init__.py
--- a/pypy/module/select/__init__.py
+++ b/pypy/module/select/__init__.py
@@ -3,6 +3,7 @@
 
 import sys
 import os
+from select import PIPE_BUF
 
 
 class Module(MixedModule):
@@ -11,7 +12,8 @@
 
     interpleveldefs = {
         'select': 'interp_select.select',
-        'error' : 'space.fromcache(interp_select.Cache).w_error'
+        'error' : 'space.fromcache(interp_select.Cache).w_error',
+        'PIPE_BUF' : 'space.wrap(%r)' % PIPE_BUF,
     }
 
     if os.name =='posix':
diff --git a/pypy/module/select/test/test_select.py 
b/pypy/module/select/test/test_select.py
--- a/pypy/module/select/test/test_select.py
+++ b/pypy/module/select/test/test_select.py
@@ -245,6 +245,10 @@
         raises(OverflowError, pollster.modify, 1, -1)
         raises(OverflowError, pollster.modify, 1, 1 << 64)
 
+    def test_PIPE_BUF(self):
+        import select
+        assert isinstance(select.PIPE_BUF, int)
+
 
 class AppTestSelectWithPipes(_AppTestSelect):
     "Use a pipe to get pairs of file descriptors"
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to