def acquire(self, blocking=False):
        import msvcrt
        self.fd = os.open(self.filename, os.O_CREAT | os.O_WRONLY)
        mode = msvcrt.LK_NBLCK
        if blocking: mode = msvcrt.LK_LOCK
        try:
            msvcrt.locking(self.fd, mode, 1)
            return True
        except __HOLE__, e:
            if e.errno not in (errno.EAGAIN, errno.EACCES, errno.EDEADLK):
                raise
            return False
dataset/ETHPy150Open dokipen/whoosh/src/whoosh/support/filelock.py/MsvcrtLock.acquire