Skip to content

Commit 1873d42

Browse files
Reverse the logic
1 parent 5a7b8a9 commit 1873d42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mongodb_consistent_backup/State.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ def __init__(self, base_dir, config, filename="meta.bson", state_version=1, meta
2323
self.lock = Lock(self.state_lock, False)
2424

2525
if not os.path.isdir(self.state_dir):
26-
# try recursive first, fallback to regular mkdir
26+
# try normal mkdir first, fallback to recursive mkdir if there is an exception
2727
try:
28-
os.makedirs(self.state_dir)
28+
os.mkdir(self.state_dir)
2929
except:
3030
try:
31-
os.mkdir(self.state_dir)
31+
os.makedirs(self.state_dir)
3232
except Exception, e:
3333
raise OperationError(e)
3434

0 commit comments

Comments
 (0)