提交 ab606357 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Make sure the Unlocker can find os.path

上级 9fb9f619
...@@ -347,6 +347,7 @@ class Unlocker(object): ...@@ -347,6 +347,7 @@ class Unlocker(object):
# Keep a pointer to the 'os' module, otherwise it may not be accessible # Keep a pointer to the 'os' module, otherwise it may not be accessible
# anymore in the __del__ method. # anymore in the __del__ method.
self.os = os self.os = os
self.path = os.path
def __del__(self): def __del__(self):
self.unlock() self.unlock()
...@@ -368,7 +369,7 @@ class Unlocker(object): ...@@ -368,7 +369,7 @@ class Unlocker(object):
# remove the file may fail (e.g. because for some reason this file does # remove the file may fail (e.g. because for some reason this file does
# not exist), we still want to try and remove the directory. # not exist), we still want to try and remove the directory.
try: try:
self.os.remove(self.os.path.join(self.tmp_dir, 'lock')) self.os.remove(self.path.join(self.tmp_dir, 'lock'))
except Exception: except Exception:
pass pass
try: try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论