extmod/uasyncio: Add error message to Lock.release's RuntimeError.
Otherwise it can be hard to understand what the error is if a blank RuntimeError is raised.
This commit is contained in:
parent
b389bc0afa
commit
aca19c25d2
@ -19,7 +19,7 @@ class Lock:
|
||||
|
||||
def release(self):
|
||||
if self.state != 1:
|
||||
raise RuntimeError
|
||||
raise RuntimeError("Lock not acquired")
|
||||
if self.waiting.peek():
|
||||
# Task(s) waiting on lock, schedule next Task
|
||||
self.state = self.waiting.pop_head()
|
||||
|
Loading…
Reference in New Issue
Block a user