Check if "_lockfile" attribute exists

This commit is contained in:
Ivan Kravets
2018-12-03 18:31:12 -08:00
parent 676c87d081
commit afdfaeec68

View File

@ -122,7 +122,7 @@ class State(object):
raise exception.HomeDirPermissionsError(dirname(self.path))
def _unlock_state_file(self):
if self._lockfile:
if hasattr(self, "_lockfile") and self._lockfile:
self._lockfile.release()
def __del__(self):