Fix for license symlinking issue. (#26576)

When a symlink to a license file exists but is broken, the license symlink post-install hook fails
because os.path.exists() checks the existence of the target not the symlink itself.
os.path.lexists() is the proper function to use.
This commit is contained in:
Paul Ferrell 2021-10-07 13:18:35 -06:00 committed by GitHub
parent 9853fd50e2
commit 0b9914e2f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,7 +175,7 @@ def symlink_license(pkg):
mkdirp(license_dir)
# If example file already exists, overwrite it with a symlink
if os.path.exists(link_name):
if os.path.lexists(link_name):
os.remove(link_name)
if os.path.exists(target):