WindowsError is a subclass of OSError

This commit is contained in:
Cheng Zhao 2015-07-03 14:46:26 +08:00
parent 7288581393
commit 2717556a92

View file

@ -133,11 +133,11 @@ def make_zip(zip_file_path, files, dirs):
def rm_rf(path):
try:
shutil.rmtree(path)
except WindowsError: # pylint: disable=E0602
pass
except OSError as e:
if e.errno != errno.ENOENT:
raise
except WindowsError: # pylint: disable=E0602
pass
def safe_unlink(path):