8000 os: check_error(): Return true for EINTR, to easily restart system ca… · micropython/micropython-lib@2441900 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2441900

Browse files
author
Paul Sokolovsky
committed
os: check_error(): Return true for EINTR, to easily restart system calls.
1 parent f128a7b commit 2441900

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

os/os/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@
5858

5959

6060
def check_error(ret):
61+
# Return True is error was EINTR (which usually means that OS call
62+
# should be restarted).
6163
if ret == -1:
62-
raise OSError(errno_.get())
64+
e = errno_.get()
65+
if e == errno.EINTR:
66+
return True
67+
raise OSError(e)
6368

6469
def raise_error():
6570
raise OSError(errno_.get())

0 commit comments

Comments
 (0)
0