From 0588e26ee6e443a358e10a1e622485ab311ab6ed Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Fri, 25 May 2018 10:39:27 -0700 Subject: [PATCH] [infer][buck] catch the correct exception when calling os.unlink on some non-existing file Reviewed By: jvillard Differential Revision: D8156486 fbshipit-source-id: 699e60d --- infer/lib/python/inferlib/bucklib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/lib/python/inferlib/bucklib.py b/infer/lib/python/inferlib/bucklib.py index ffbbad4cb..f5e87e284 100644 --- a/infer/lib/python/inferlib/bucklib.py +++ b/infer/lib/python/inferlib/bucklib.py @@ -209,7 +209,7 @@ def cleanup(temp_files): shutil.rmtree(file) else: os.unlink(file) - except IOError: + except OSError: logging.error('Could not remove %s' % file)