[pypy-commit] pypy kqueue: Fix module init, test init.
oberstet
noreply at buildbot.pypy.org
Sun Mar 4 20:39:21 CET 2012
Author: Tobias Oberstein <tobias.oberstein at gmail.com>
Branch: kqueue
Changeset: r53189:e46a58cf8ee6
Date: 2012-03-02 13:40 +0100
http://bitbucket.org/pypy/pypy/changeset/e46a58cf8ee6/
Log: Fix module init, test init.
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
@@ -22,7 +22,7 @@
if value is not None:
interpleveldefs[symbol] = "space.wrap(%r)" % value
- if hasattr(select, "kqueue"):
+ if sys.platform.startswith('freebsd') or sys.platform.startswith('darwin'):
interpleveldefs["kqueue"] = "interp_kqueue.W_Kqueue"
interpleveldefs["kevent"] = "interp_kqueue.W_Kevent"
diff --git a/pypy/module/select/test/test_kqueue.py b/pypy/module/select/test/test_kqueue.py
--- a/pypy/module/select/test/test_kqueue.py
+++ b/pypy/module/select/test/test_kqueue.py
@@ -1,16 +1,16 @@
+import py
+import sys
+
from pypy.conftest import gettestobjspace
class AppTestKqueue(object):
def setup_class(cls):
- import errno
- import select
-
+ if not sys.platform.startswith('freebsd') and \
+ not sys.platform.startswith('darwin'):
+ py.test.skip("test requires BSD")
cls.space = gettestobjspace(usemodules=["select", "_socket", "posix"])
- if not hasattr(select, "kqueue"):
- py.test.skip("test requires BSD")
-
def test_create(self):
import select
More information about the pypy-commit
mailing list