From f5f38a1fbd0d666c888ff104bfa9df4c8c70c495 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 6 Nov 2022 18:22:56 +0100 Subject: [PATCH] remove python < 3.7 compatibility code not supported any more in master and 1.2-maint branches. --- src/borg/helpers/fs.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/borg/helpers/fs.py b/src/borg/helpers/fs.py index 25e36567e..290d5e9a4 100644 --- a/src/borg/helpers/fs.py +++ b/src/borg/helpers/fs.py @@ -20,9 +20,6 @@ from ..logger import create_logger logger = create_logger() -py_37_plus = sys.version_info >= (3, 7) - - def ensure_dir(path, mode=stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO, pretty_deadly=True): """ Ensures that the dir exists with the right permissions. @@ -259,8 +256,7 @@ def scandir_keyfunc(dirent): def scandir_inorder(*, path, fd=None): - # py37+ supports giving an fd instead of a path (no full entry.path in DirEntry in that case!) - arg = fd if fd is not None and py_37_plus else path + arg = fd if fd is not None else path return sorted(os.scandir(arg), key=scandir_keyfunc)