Author: mattip <[email protected]>
Branch: 
Changeset: r59414:ed989c52b6ed
Date: 2012-12-13 15:26 -0800
http://bitbucket.org/pypy/pypy/changeset/ed989c52b6ed/

Log:    try to wrap socket.error for testing

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
@@ -272,6 +272,7 @@
         w_import = space.getattr(space.builtin, space.wrap("__import__"))
         w_socketmod = space.call_function(w_import, space.wrap("socket"))
         cls.w_sock = cls.space.call_method(w_socketmod, "socket")
+        cls.w_sock_err = space.getattr(w_socketmod, space.wrap("error"))
 
         try_ports = [1023] + range(20000, 30000, 437)
         for port in try_ports:
@@ -279,11 +280,8 @@
             cls.w_sockaddress = space.wrap(('127.0.0.1', port))
             try:
                 space.call_method(cls.w_sock, "bind", cls.w_sockaddress)
-                print 'works'
                 break
-            except OperationError, e:   # should get a "Permission denied"
-                if not e.match(space, space.getattr(w_socketmod, 
space.wrap("error"))):
-                    raise
+            except cls.w_sock_err, e:   # should get a "Permission denied"
                 print e
             else:
                 raise e
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to