from __future__ import with_statement
+from __future__ import absolute_import
import unittest
from fcntl import flock, LOCK_EX, LOCK_SH, LOCK_UN
import contextlib as clib
@clib.contextmanager
def lock_file(path, exclusive = True):
- with clib.closing(file(path, 'w')) as f:
+ with clib.closing(open(path, 'w')) as f:
if exclusive:
locktype = LOCK_EX
else: