[PATCH] rtemstoolkit/path : print OSError in mkdir

Vijay Kumar Banerjee vijaykumar9597 at gmail.com
Mon May 20 11:24:27 UTC 2019


---
 rtemstoolkit/path.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/rtemstoolkit/path.py b/rtemstoolkit/path.py
index 0044c7b..5cf6157 100644
--- a/rtemstoolkit/path.py
+++ b/rtemstoolkit/path.py
@@ -126,17 +126,17 @@ def mkdir(path):
                 os.makedirs(host(path))
             except IOError:
                 raise error.general('cannot make directory: %s' % (path))
-            except OSError:
-                raise error.general('cannot make directory: %s' % (path))
-            except WindowsError:
-                raise error.general('cannot make directory: %s' % (path))
+            except OSError as e:
+                raise error.general('cannot make directory: %s: %s' % (path, str(e)))
+            except WindowsError as e:
+                raise error.general('cannot make directory: %s: %s' % (path, str(e)))
         else:
             try:
                 os.makedirs(host(path))
             except IOError:
                 raise error.general('cannot make directory: %s' % (path))
-            except OSError:
-                raise error.general('cannot make directory: %s' % (path))
+            except OSError as e:
+                raise error.general('cannot make directory: %s: %s' % (path, str(e)))
 
 def removeall(path):
 
-- 
2.20.1



More information about the devel mailing list