Skip to content
Snippets Groups Projects
Commit 3376875b authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/modtime: sleep(): Return early if KeyboardInterrupt is pending

As set by signal handler. This assumes that exception will be raised
somewhere else, which so far doesn't happen for single function call.
Still, it makes sense to handle that in some common place.
parent 0d9b4507
No related branches found
No related tags found
No related merge requests found
......@@ -125,6 +125,9 @@ STATIC mp_obj_t mod_time_sleep(mp_obj_t arg) {
if (res != -1 || errno != EINTR) {
break;
}
if (MP_STATE_VM(mp_pending_exception) != MP_OBJ_NULL) {
return mp_const_none;
}
//printf("select: EINTR: %ld:%ld\n", tv.tv_sec, tv.tv_usec);
#else
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment