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:
Kevin Köck 2020-03-28 14:55:59 +01:00 committed by Damien George
parent b389bc0afa
commit aca19c25d2

View File

@ -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()