69
69
"""Acquire the lock in write mode.
71
71
If the lock was originally acquired in read mode this will fail.
73
77
:returns: The token from the underlying lock.
75
79
if self._lock_count == 0:
78
82
elif self._lock_mode != 'w':
79
83
raise ReadOnlyError(self)