mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
On Py3, nonexistent files raise OSError (#28899)
This commit is contained in:
parent
c95e03d213
commit
e132918b92
1 changed files with 2 additions and 1 deletions
3
setup.py
3
setup.py
|
@ -59,7 +59,8 @@ def _maintain_symlinks(symlink_type, base_path):
|
||||||
# only time we know that we're going to cache correctly
|
# only time we know that we're going to cache correctly
|
||||||
with open(SYMLINK_CACHE, 'r') as f:
|
with open(SYMLINK_CACHE, 'r') as f:
|
||||||
symlink_data = json.loads(f.read())
|
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:
|
if e.errno == 2:
|
||||||
# SYMLINKS_CACHE doesn't exist. Fallback to trying to create the
|
# SYMLINKS_CACHE doesn't exist. Fallback to trying to create the
|
||||||
# cache now. Will work if we're running directly from a git
|
# cache now. Will work if we're running directly from a git
|
||||||
|
|
Loading…
Reference in a new issue