Chore: switch from os.path to pathlib.Path (#9339)

This commit is contained in:
Sebastian Steinbeißer
2025-04-21 21:16:52 +02:00
committed by GitHub
parent c3df7d3439
commit 648cfd9d05
7 changed files with 197 additions and 229 deletions

View File

@@ -1,4 +1,3 @@
import os
import shutil
from pathlib import Path
@@ -8,11 +7,11 @@ from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import TestMigrations
def source_path_before(self):
def source_path_before(self) -> Path:
if self.filename:
fname = str(self.filename)
return os.path.join(settings.ORIGINALS_DIR, fname)
return Path(settings.ORIGINALS_DIR) / fname
class TestMigrateDocumentPageCount(DirectoriesMixin, TestMigrations):