Skip to content

Commit

Permalink
update to python 3 imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Skip Montanaro committed Feb 24, 2013
1 parent eeead7d commit 379fa0b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lockfile/__init__.py
@@ -1,4 +1,3 @@

"""
lockfile.py - Platform-independent advisory file locks.
Expand Down Expand Up @@ -50,6 +49,8 @@
NotMyLock - File was locked but not by the current thread/process
"""

from __future__ import absolute_import

import sys
import socket
import os
Expand Down Expand Up @@ -257,7 +258,7 @@ def LinkFileLock(*args, **kwds):
Do not use in new code. Instead, import LinkLockFile from the
lockfile.linklockfile module.
"""
import linklockfile
from . import linklockfile
return _fl_helper(linklockfile.LinkLockFile, "lockfile.linklockfile",
*args, **kwds)

Expand All @@ -267,7 +268,7 @@ def MkdirFileLock(*args, **kwds):
Do not use in new code. Instead, import MkdirLockFile from the
lockfile.mkdirlockfile module.
"""
import mkdirlockfile
from . import mkdirlockfile
return _fl_helper(mkdirlockfile.MkdirLockFile, "lockfile.mkdirlockfile",
*args, **kwds)

Expand All @@ -277,7 +278,7 @@ def SQLiteFileLock(*args, **kwds):
Do not use in new code. Instead, import SQLiteLockFile from the
lockfile.mkdirlockfile module.
"""
import sqlitelockfile
from . import sqlitelockfile
return _fl_helper(sqlitelockfile.SQLiteLockFile, "lockfile.sqlitelockfile",
*args, **kwds)

Expand Down Expand Up @@ -306,10 +307,10 @@ def wrapper(*args, **kwargs):
return decor

if hasattr(os, "link"):
import linklockfile as _llf
from . import linklockfile as _llf
LockFile = _llf.LinkLockFile
else:
import mkdirlockfile as _mlf
from . import mkdirlockfile as _mlf
LockFile = _mlf.MkdirLockFile

FileLock = LockFile
Expand Down

0 comments on commit 379fa0b

Please sign in to comment.