From aca19c25d250b8abb91211e2392e01b5611325c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20K=C3=B6ck?= Date: Sat, 28 Mar 2020 14:55:59 +0100 Subject: [PATCH] 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. --- extmod/uasyncio/lock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/uasyncio/lock.py b/extmod/uasyncio/lock.py index 18a55cb483..bddca295b6 100644 --- a/extmod/uasyncio/lock.py +++ b/extmod/uasyncio/lock.py @@ -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()