# -*- coding: utf-8 -*-
# Copyright (c) 2009 Evan Fosmark
-# Copyright (c) 2014 Jack Kaliko <kaliko@azylum.org>
+# Copyright (c) 2014 kaliko <kaliko@azylum.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
import os
import time
+
class FileLockException(Exception):
"""FileLock Exception"""
- pass
+
class FileLock:
""" A plain file lock whit context-manager"""
while True:
try:
self.filedsc = os.open(self.lockfile,
- os.O_CREAT|os.O_EXCL|os.O_RDWR)
+ os.O_CREAT | os.O_EXCL | os.O_RDWR)
break
except OSError as err:
if err.errno != errno.EEXIST: