summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Poignant <oliver@poignant.se>2016-06-13 23:18:18 +0200
committerOliver Poignant <oliver@poignant.se>2016-06-13 23:18:18 +0200
commitfb67fb63bfe8abbd0e0ac0ab143c05be41d84c9f (patch)
tree2c4331f83c33fdaea2a44fd2fde697f0a1608ce2
parente70fa110381557e9e688dfad13d02a912ce7dba1 (diff)
downloadGit-Auto-Deploy-fb67fb63bfe8abbd0e0ac0ab143c05be41d84c9f.zip
Git-Auto-Deploy-fb67fb63bfe8abbd0e0ac0ab143c05be41d84c9f.tar.gz
Git-Auto-Deploy-fb67fb63bfe8abbd0e0ac0ab143c05be41d84c9f.tar.bz2
Compatibility with older versions of lockfile module
-rw-r--r--gitautodeploy/lock.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/gitautodeploy/lock.py b/gitautodeploy/lock.py
index d408182..126496b 100644
--- a/gitautodeploy/lock.py
+++ b/gitautodeploy/lock.py
@@ -1,4 +1,3 @@
-from lockfile import LockFile
class Lock():
"""Simple implementation of a mutex lock using the file systems. Works on
@@ -8,6 +7,13 @@ class Lock():
lock = None
def __init__(self, path):
+ try:
+ from lockfile import LockFile
+ except ImportError:
+ from lockfile import FileLock
+ # Different naming in older versions of lockfile
+ LockFile = FileLock
+
self.path = path
self.lock = LockFile(path)