114
114
class _fcntl_WriteLock(_fcntl_FileLock):
118
118
def __init__(self, filename):
119
119
# standard IO errors get exposed directly.
120
120
super(_fcntl_WriteLock, self).__init__()
121
127
self._open(filename, 'rb+')
126
128
# reserve a slot for this lock - even if the lockf call fails,
127
129
# at thisi point unlock() will be called, because self.f is set.
128
130
# TODO: make this fully threadsafe, if we decide we care.
131
133
# LOCK_NB will cause IOError to be raised if we can't grab a