[pypy-svn] pypy default: When EINTR is raised, the application has received a signal;

amauryfa commits-noreply at bitbucket.org
Tue Jan 25 01:42:27 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r41281:66190a53723f
Date: 2011-01-25 01:40 +0100
http://bitbucket.org/pypy/pypy/changeset/66190a53723f/

Log:	When EINTR is raised, the application has received a signal; give
	the signal handlers a chance to run.

	I'm not sure how to test this in RPython. CPython has the same call
	in PyErr_SetFromErrno(). This change should unblock test_io.py.

diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py
--- a/pypy/interpreter/error.py
+++ b/pypy/interpreter/error.py
@@ -1,6 +1,7 @@
 import os, sys
 from pypy.rlib.objectmodel import we_are_translated
 from pypy.rlib import jit
+from errno import EINTR
 
 AUTO_DEBUG = os.getenv('PYPY_DEBUG')
 RECORD_INTERPLEVEL_TRACEBACK = True
@@ -366,6 +367,10 @@
         return wrap_windowserror(space, e, w_filename)
 
     errno = e.errno
+
+    if errno == EINTR:
+        space.getexecutioncontext().checksignals()
+
     try:
         msg = os.strerror(errno)
     except ValueError:


More information about the Pypy-commit mailing list