From e132918b925108e7d5cba5bc3ded2c5aea272fff Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 31 Aug 2017 14:47:26 -0700 Subject: [PATCH] On Py3, nonexistent files raise OSError (#28899) --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4345e4206e5..c934a2f4fd9 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,8 @@ def _maintain_symlinks(symlink_type, base_path): # only time we know that we're going to cache correctly with open(SYMLINK_CACHE, 'r') as f: symlink_data = json.loads(f.read()) - except IOError as e: + except (IOError, OSError) as e: + # IOError on py2, OSError on py3. Both have errno if e.errno == 2: # SYMLINKS_CACHE doesn't exist. Fallback to trying to create the # cache now. Will work if we're running directly from a git