Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r90565:4503c9682c20
Date: 2017-03-05 12:58 +0100
http://bitbucket.org/pypy/pypy/changeset/4503c9682c20/
Log: only expose sendfile() on linux, instead of warnings/errors during
OS/X translation
diff --git a/pypy/module/posix/__init__.py b/pypy/module/posix/__init__.py
--- a/pypy/module/posix/__init__.py
+++ b/pypy/module/posix/__init__.py
@@ -213,7 +213,7 @@
assert getattr(rposix, _name) is not None, "missing %r" % (_name,)
interpleveldefs[_name] = 'space.wrap(%d)' % getattr(rposix, _name)
- if hasattr(rposix, 'sendfile'):
+ if sys.platform.startswith('linux'): #hasattr(rposix, 'sendfile'):
interpleveldefs['sendfile'] = 'interp_posix.sendfile'
for _name in ["O_CLOEXEC"]:
diff --git a/pypy/module/posix/interp_posix.py
b/pypy/module/posix/interp_posix.py
--- a/pypy/module/posix/interp_posix.py
+++ b/pypy/module/posix/interp_posix.py
@@ -24,7 +24,6 @@
_WIN32 = sys.platform == 'win32'
-_LINUX = sys.platform.startswith('linux')
if _WIN32:
from rpython.rlib import rwin32
@@ -2357,8 +2356,9 @@
# "in" would require all sorts of special cases. I hope nobody
# relies on the strange name of CPython.
- # XXX only supports the common arguments for now (BSD takes more)
- if _LINUX and space.is_none(w_offset):
+ # XXX only supports the common arguments for now (BSD takes more).
+ # Until that is fixed, we only expose sendfile() on linux.
+ if space.is_none(w_offset): # linux only
while True:
try:
res = rposix.sendfile_no_offset(out, in_, count)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit