[PATCH] rtemstoolkit/path : print OSError in mkdir

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


Pushed. Thank you.

On 20/5/19 9:24 pm, Vijay Kumar Banerjee wrote:
> ---
>  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):
>  
> 



More information about the devel mailing list