11 if err.errno == os.errno.ENOENT:
12 head, tail = os.path.split(name)
15 elif err.errno == os.errno.EEXIST:
20 def link_or_copy(src, dest):
24 shutil.copyfile(src, dest)
26 def remove_tree_contents(dir):
27 for f in os.listdir(dir):
28 name = os.path.join(dir, f)
32 if err.errno == os.errno.EISDIR:
33 shutil.rmtree(os.path.join(dir, f))