diff --git a/src/yunohost/data_migrations/0021_migrate_to_bullseye.py b/src/yunohost/data_migrations/0021_migrate_to_bullseye.py index cb8a333f5..162b8e376 100644 --- a/src/yunohost/data_migrations/0021_migrate_to_bullseye.py +++ b/src/yunohost/data_migrations/0021_migrate_to_bullseye.py @@ -39,8 +39,11 @@ def _get_all_venvs(dir, level=0, maxlevel=3): maxlevel - the depth of the recursion level - do not edit this, used as an iterator """ - # Using os functions instead of glob, because glob doesn't support hidden folders, and we need recursion with a fixed depth + if not os.path.exists(dir): + return [] + result = [] + # Using os functions instead of glob, because glob doesn't support hidden folders, and we need recursion with a fixed depth for file in os.listdir(dir): path = os.path.join(dir, file) if os.path.isdir(path):