Raise a more helpful error message is a directory does not exist
authorW. Trevor King <wking@drexel.edu>
Fri, 16 Jul 2010 05:17:14 +0000 (01:17 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 16 Jul 2010 05:17:14 +0000 (01:17 -0400)
dirtag/__init__.py

index b8f49c75d6e9ee37bb56ff939dd564b601dd4c27..406c2860225cd6cc8809bad24b04065bbe55aedf 100644 (file)
@@ -71,6 +71,8 @@ def dir_tree(root_dir):
     x|a2.dat
     x|b3.dat
     """
     x|a2.dat
     x|b3.dat
     """
+    if not os.path.exists(root_dir):
+        raise ValueError(root_dir)
     trees = {}
     for dirpath,dirnames,filenames in os.walk(root_dir, followlinks=True):
         t = trees.get(
     trees = {}
     for dirpath,dirnames,filenames in os.walk(root_dir, followlinks=True):
         t = trees.get(