Do not fail at hook removal (fixes #57)

This commit is contained in:
Alexis Gavoty 2013-12-19 13:50:32 +01:00
parent 148308e8e5
commit c5f3488014

View file

@ -66,10 +66,12 @@ def hook_remove(app):
app -- Scripts related to app will be removed
"""
for action in os.listdir(hook_folder):
for script in os.listdir(hook_folder + action):
if script.endswith(app):
os.remove(hook_folder + action +'/'+ script)
try:
for action in os.listdir(hook_folder):
for script in os.listdir(hook_folder + action):
if script.endswith(app):
os.remove(hook_folder + action +'/'+ script)
except OSError: pass
def hook_callback(action, args=None):