Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r97257:188c336c0f74
Date: 2019-08-25 20:24 +0300
http://bitbucket.org/pypy/pypy/changeset/188c336c0f74/
Log: cpython compatibility
diff --git a/pypy/module/select/interp_epoll.py
b/pypy/module/select/interp_epoll.py
--- a/pypy/module/select/interp_epoll.py
+++ b/pypy/module/select/interp_epoll.py
@@ -87,10 +87,12 @@
self.register_finalizer(space)
@unwrap_spec(sizehint=int, flags=int)
- def descr__new__(space, w_subtype, sizehint=0, flags=0):
- if sizehint < 0: # 'sizehint' is otherwise ignored
+ def descr__new__(space, w_subtype, sizehint=-1, flags=0):
+ if sizehint == -1:
+ sizehint = FD_SETSIZE - 1
+ elif sizehint <= 0: # 'sizehint' is otherwise ignored
raise oefmt(space.w_ValueError,
- "sizehint must be greater than zero, got %d", sizehint)
+ "sizehint must be positive or -1")
epfd = epoll_create1(flags | EPOLL_CLOEXEC)
if epfd < 0:
raise exception_from_saved_errno(space, space.w_IOError)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit