From 5e5b8b844f9b0c54f19be7e78545f52bb825d2ec Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 8 Aug 2016 13:39:01 +0200 Subject: [PATCH] Cosmetics --- radicale/storage.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/radicale/storage.py b/radicale/storage.py index db68d42..730e691 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -392,9 +392,9 @@ class Collection(BaseCollection): @contextmanager def _atomic_write(self, path, mode="w"): - dir = os.path.dirname(path) - tmp = NamedTemporaryFile(mode=mode, dir=dir, encoding=self.encoding, - delete=False, prefix=".Radicale.tmp-") + tmp = NamedTemporaryFile( + mode=mode, dir=os.path.dirname(path), encoding=self.encoding, + delete=False, prefix=".Radicale.tmp-") try: yield tmp if self.configuration.getboolean("storage", "fsync"): @@ -650,10 +650,10 @@ class Collection(BaseCollection): try: os.rmdir(self._filesystem_path) except OSError: - with TemporaryDirectory(prefix=".Radicale.tmp-", - dir=parent_dir) as tmp_dir: + with TemporaryDirectory( + prefix=".Radicale.tmp-", dir=parent_dir) as tmp: os.rename(self._filesystem_path, os.path.join( - tmp_dir, os.path.basename(self._filesystem_path))) + tmp, os.path.basename(self._filesystem_path))) self._sync_directory(parent_dir) else: self._sync_directory(parent_dir)