Use os.path.join() where possible

This commit is contained in:
XANTRONIX Industrial 2025-02-12 15:37:14 -05:00
parent b9ca5c0c89
commit 015ba27c33

View file

@ -11,10 +11,10 @@ class Archive():
self.bucket = bucket self.bucket = bucket
def is_archived(self, key: str): def is_archived(self, key: str):
return os.path.exists(self.path + '/' + key) return os.path.exists(os.path.join(self.path, key))
def archive(self, key: str): def archive(self, key: str):
path = self.path + '/' + key path = os.path.join(self.path, key)
parent = os.path.dirname(path) parent = os.path.dirname(path)
os.makedirs(parent, exist_ok=True) os.makedirs(parent, exist_ok=True)