From 25aff60231b13be18cea1914ce06152c2982bc8e Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 18 Sep 2015 11:36:39 +0200 Subject: fb.py: makedirs: Check if dir already exists Signed-off-by: Florian Pritz --- fb.py | 6 ++++-- 1 file 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): -- cgit v1.2.3-24-g4f1b