瀏覽代碼

remove python < 3.7 compatibility code

not supported any more in master and 1.2-maint branches.
Thomas Waldmann 2 年之前
父節點
當前提交
f1a355f3d9
共有 1 個文件被更改,包括 1 次插入5 次删除
  1. 1 5
      src/borg/helpers/fs.py

+ 1 - 5
src/borg/helpers/fs.py

@@ -18,9 +18,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.
@@ -184,8 +181,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)