X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Futils%2Ffilelock.py;h=81f9d3c5c14b81988168eb02c0edc9ff024c6359;hb=e86c25ed9e97c5dd3e0672d5b17bed01d4a23fdf;hp=959f6362d977503718d6c6e37c3addbcba6d771b;hpb=37dd60538984a3917354b794a5c96b0a025f8e95;p=mpd-sima.git diff --git a/sima/utils/filelock.py b/sima/utils/filelock.py index 959f636..81f9d3c 100644 --- a/sima/utils/filelock.py +++ b/sima/utils/filelock.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2009 Evan Fosmark -# Copyright (c) 2014 kaliko +# Copyright (c) 2014, 2021 kaliko # # 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 @@ -65,7 +65,7 @@ class FileLock: if err.errno != errno.EEXIST: raise if (time.time() - start_time) >= self.timeout: - raise FileLockException('Timeout occured.') + raise FileLockException('Timeout occured.') from err time.sleep(self.delay) self.is_locked = True @@ -84,7 +84,7 @@ class FileLock: self.acquire() return self - def __exit__(self, type, value, traceback): + def __exit__(self, ex_type, ex_value, ex_traceback): """end of the with statement """ if self.is_locked: