diff --git a/IPython/html/widgets/widget_selection.py b/IPython/html/widgets/widget_selection.py
index c27e5f8..bf158d2 100644
--- a/IPython/html/widgets/widget_selection.py
+++ b/IPython/html/widgets/widget_selection.py
@@ -99,10 +99,8 @@ class _Selection(DOMWidget):
self.value = next(iter(self.values_values))
def _values_readonly_changed(self, name, old, new):
- if not self.values_lock.acquire(False):
+ if not self.values_lock.locked():
raise TraitError("`.%s` is a read-only trait. Use the `.values` tuple instead." % name)
- else:
- self.values_lock.release()
def _value_changed(self, name, old, new):
"""Called when value has been changed"""