Commit cb6a2281 authored by gsamain's avatar gsamain

With lock statement silently accept perceived inconsistent lock states for nolock cyobjects

parent 559c7bf1
......@@ -8221,6 +8221,7 @@ class LockCypclassNode(StatNode):
is_rlocked = self.obj.is_rhs_locked(env)
is_wlocked = self.obj.is_lhs_locked(env)
if self.obj.type.lock_mode != "nolock":
if self.state == "unclocked" and not (is_rlocked or is_wlocked):
error(self.pos, "Cannot unlock an already unlocked object !")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment