dont crash if directory doesn't exist stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 04 Dec 2009 19:45:58 +0100
branchstable
changeset 4001 bc31ede2085d
parent 4000 4b16a7c01a25
child 4002 4edff8bce44b
dont crash if directory doesn't exist
cwconfig.py
--- a/cwconfig.py	Fri Dec 04 19:45:32 2009 +0100
+++ b/cwconfig.py	Fri Dec 04 19:45:58 2009 +0100
@@ -331,6 +331,10 @@
     def available_cubes(cls):
         cubes = set()
         for directory in cls.cubes_search_path():
+            if not os.path.exists(directory):
+                self.error('unexistant directory in cubes search path: %s'
+                           % directory)
+                continue
             for cube in os.listdir(directory):
                 if isdir(join(directory, cube)) and not cube == 'shared':
                     cubes.add(cube)