summaryrefslogtreecommitdiffstats
path: root/fb.py
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-09-18 11:36:39 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-09-18 11:36:39 +0200
commit25aff60231b13be18cea1914ce06152c2982bc8e (patch)
tree0bfa3f0d71170dff962d9768c63681b5624ebbc9 /fb.py
parenta1f172454d58a6ed8cf94223580e47a84ae2d3d0 (diff)
fb.py: makedirs: Check if dir already exists
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.py')
-rwxr-xr-xfb.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/fb.py b/fb.py
index 2d057e2..fc0d73b 100755
--- a/fb.py
+++ b/fb.py
@@ -408,10 +408,12 @@ class FBClient:
functions[self.args.mode]()
def makedirs(self, path):
+ dirname = os.path.dirname(path)
try:
- os.makedirs(os.path.dirname(path))
+ os.makedirs(dirname)
except OSError as e:
- # FIXME: only catch dir already exists error
+ if not (os.path.exists(dirname) and os.path.isdir(dirname)):
+ raise
pass
def create_temp_copy_path(self, file):