def retry_on_signal(function):
while True:<EOL><INDENT>try:<EOL><INDENT>return function()<EOL><DEDENT>except EnvironmentError as e:<EOL><INDENT>if e.errno != errno.EINTR:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>
Retries function until it doesn't raise an EINTR error