瀏覽代碼

fix a bug in metadata path initialisation

Christian Mönch 2 年之前
父節點
當前提交
f238335d40
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      dataladmetadatamodel/metadatapath.py

+ 8 - 6
dataladmetadatamodel/metadatapath.py

@@ -5,12 +5,14 @@ from dataladmetadatamodel.log import logger
 
 class MetadataPath(PurePosixPath):
     def __new__(cls, *args):
-        args = [
-            arg.replace("\\", "/")
-            for arg in args
-            if isinstance(arg, str)
-        ]
-        original_path = PurePosixPath(*args)
+
+        posix_args = []
+        for arg in args:
+            if isinstance(arg, str):
+                arg.replace("\\", "/")
+            posix_args.append(arg)
+
+        original_path = PurePosixPath(*posix_args)
         if not original_path.is_absolute():
             created_path = super().__new__(
                 cls,