diff makeitso/python_package/{{package}}/{{main}}.py @ 205:0a991b8fe839

better check
author Jeff Hammel <k0scist@gmail.com>
date Fri, 21 Nov 2014 12:19:07 -0800
parents be7e2e336d7a
children d9d7bfdb54db
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