(self)
| 349 | """ |
| 350 | |
| 351 | def _acquire(self): |
| 352 | open_mode = os.O_RDWR | os.O_CREAT | os.O_TRUNC |
| 353 | |
| 354 | try: |
| 355 | fd = os.open(self._lock_file, open_mode) |
| 356 | except OSError: |
| 357 | pass |
| 358 | else: |
| 359 | try: |
| 360 | msvcrt.locking(fd, msvcrt.LK_NBLCK, 1) |
| 361 | except (IOError, OSError): |
| 362 | os.close(fd) |
| 363 | else: |
| 364 | self._lock_file_fd = fd |
| 365 | return None |
| 366 | |
| 367 | def _release(self): |
| 368 | fd = self._lock_file_fd |