Commit 9a465793 authored by Laurent EL SHAFEY's avatar Laurent EL SHAFEY
Browse files

Merge branch 'master' of /idiap/group/torch5spro/sandboxes/gridtk

parents ce7985e5 566097df
......@@ -36,7 +36,7 @@ def try_remove_files(filename, recurse, verbose):
os.unlink(k)
if verbose: print verbose + ("removed `%s'" % k)
d = os.path.dirname(k)
if recurse and not os.listdir(d):
if recurse and os.path.exists(d) and not os.listdir(d):
os.removedirs(d)
if verbose: print verbose + ("recursively removed `%s'" % d)
......@@ -45,7 +45,7 @@ def try_remove_files(filename, recurse, verbose):
os.unlink(filename)
if verbose: print verbose + ("removed `%s'" % filename)
d = os.path.dirname(filename)
if recurse and not os.listdir(d):
if recurse and os.path.exists(d) and not os.listdir(d):
os.removedirs(d)
if verbose: print verbose + ("recursively removed `%s'" % d)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment