From d5da3d899ac53650364a1ff9b2c58a6e26632478 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 1 Jan 2021 05:04:33 +0100 Subject: [PATCH] Ignore the __pycache__ folder in diagnosis hook folder --- src/yunohost/hook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yunohost/hook.py b/src/yunohost/hook.py index 94126fd36..067a5d7a7 100644 --- a/src/yunohost/hook.py +++ b/src/yunohost/hook.py @@ -182,7 +182,8 @@ def hook_list(action, list_by='name', show_info=False): def _append_folder(d, folder): # Iterate over and add hook from a folder for f in os.listdir(folder + action): - if f[0] == '.' or f[-1] == '~' or f.endswith(".pyc"): + if f[0] == '.' or f[-1] == '~' or f.endswith(".pyc") \ + or (f.startswith("__") and f.endswith("__")): continue path = '%s%s/%s' % (folder, action, f) priority, name = _extract_filename_parts(f)