diff options
author | Omer Katz <omer.drow@gmail.com> | 2021-09-17 13:36:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-17 13:36:41 (GMT) |
commit | 778b07565e38cc94aa90318eb47b9cd09716756a (patch) | |
tree | 0eeab654c4a68faed8d0b48fb763f52bf718db89 /Lib/platform.py | |
parent | 54a1760cde7bb01e5574734c389c0746762218fd (diff) | |
download | cpython-778b07565e38cc94aa90318eb47b9cd09716756a.zip cpython-778b07565e38cc94aa90318eb47b9cd09716756a.tar.gz cpython-778b07565e38cc94aa90318eb47b9cd09716756a.tar.bz2 |
Remove compatibility check for Python versions below 2.2. (GH-28314)
`os.path.realpath()` already exists in all our supported Python versions.
There's no longer a need to check if it exists or not.
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 0f17964..240f701 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -187,11 +187,10 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384): executable = sys.executable V = _comparable_version - if hasattr(os.path, 'realpath'): - # Python 2.2 introduced os.path.realpath(); it is used - # here to work around problems with Cygwin not being - # able to open symlinks for reading - executable = os.path.realpath(executable) + # We use os.path.realpath() + # here to work around problems with Cygwin not being + # able to open symlinks for reading + executable = os.path.realpath(executable) with open(executable, 'rb') as f: binary = f.read(chunksize) pos = 0 |