liukaiwen пре 1 година
родитељ
комит
9fee2ce09f
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      magic_pdf/io/DiskReaderWriter.py

+ 2 - 2
magic_pdf/io/DiskReaderWriter.py

@@ -35,8 +35,8 @@ class DiskReaderWriter(AbsReaderWriter):
             abspath = path
         else:
             abspath = os.path.join(self.path, path)
-        if not os.path.exists(abspath):
-            directory_path = os.path.dirname(abspath)
+        directory_path = os.path.dirname(abspath)
+        if not os.path.exists(directory_path):
             os.makedirs(directory_path)
         if mode == MODE_TXT:
             with open(abspath, "w", encoding=self.encoding) as f: