def check_error(ret): # Return True is error was EINTR (which usually means that OS call # should be restarted). if ret == -1: e = uos.errno() if e == errno_.EINTR: return True raise OSError(e)
def check_error(ret, hide_eintr=False): # If hide_eintr is set and error was EINTR, return True. (Which usually # means that OS call should be restarted). if ret == -1: e = uos.errno() if hide_eintr and e == errno.EINTR: return True raise OSError(e)
def timer_delete(tid): try: r = timer_delete_(tid) # print("timer_delete", r, uos.errno()) os.check_error(r) except OSError: e = uos.errno() if e != errno.EINVAL: raise(e)
def raise_error(): raise OSError(uos.errno())