Ticket #5362: winlockfile.patch

File winlockfile.patch, 627 bytes (added by Antoine Pitrou, 9 years ago)
  • twisted/python/lockfile.py

    diff --git a/twisted/python/lockfile.py b/twisted/python/lockfile.py
    a b Filesystem-based interprocess mutex. 
    99
    1010__metaclass__ = type
    1111
    12 import errno, os
     12import errno, os, sys
    1313
    1414from time import time as _uniquefloat
    1515
    def unique(): 
    1717    return str(long(_uniquefloat() * 1000))
    1818
    1919from os import rename
    20 try:
     20if sys.platform != 'win32':
    2121    from os import kill
    2222    from os import symlink
    2323    from os import readlink
    2424    from os import remove as rmlink
    2525    _windows = False
    26 except:
     26else:
    2727    _windows = True
    2828
    2929    try: