[rtems-tools commit] rtemstoolkit/path : print OSError in mkdir

Chris Johns chrisj at rtems.org
Tue May 21 05:56:10 UTC 2019


Module:    rtems-tools
Branch:    master
Commit:    6c79a16e209e9f61904114ad82bac650417508e2
Changeset: http://git.rtems.org/rtems-tools/commit/?id=6c79a16e209e9f61904114ad82bac650417508e2

Author:    Vijay Kumar Banerjee <vijaykumar9597 at gmail.com>
Date:      Mon May 20 17:12:27 2019 +0530

rtemstoolkit/path : print OSError in mkdir

---

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

diff --git a/rtemstoolkit/path.py b/rtemstoolkit/path.py
index 6b63c8a..845dfe8 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):
 



More information about the vc mailing list