changeset 205:0a991b8fe839

better check
author Jeff Hammel <k0scist@gmail.com>
date Fri, 21 Nov 2014 12:19:07 -0800
parents 388b4bb3516c
children d9d7bfdb54db
files makeitso/python_package/{{package}}/{{main}}.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/makeitso/python_package/{{package}}/{{main}}.py	Tue Oct 28 13:47:43 2014 -0700
+++ b/makeitso/python_package/{{package}}/{{main}}.py	Fri Nov 21 12:19:07 2014 -0800
@@ -19,7 +19,8 @@
 def ensure_dir(directory):
     """ensure a directory exists"""
     if os.path.exists(directory):
-        assert os.path.isdir(directory)
+        if not os.path.isdir(directory):
+            raise OSError("Not a directory: '{}'".format(directory))
         return directory
     os.makedirs(directory)
     return directory