mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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>
This commit is contained in:
parent
54a1760cde
commit
778b07565e
1 changed files with 4 additions and 5 deletions
|
@ -187,11 +187,10 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384):
|
||||||
executable = sys.executable
|
executable = sys.executable
|
||||||
|
|
||||||
V = _comparable_version
|
V = _comparable_version
|
||||||
if hasattr(os.path, 'realpath'):
|
# We use os.path.realpath()
|
||||||
# Python 2.2 introduced os.path.realpath(); it is used
|
# here to work around problems with Cygwin not being
|
||||||
# here to work around problems with Cygwin not being
|
# able to open symlinks for reading
|
||||||
# able to open symlinks for reading
|
executable = os.path.realpath(executable)
|
||||||
executable = os.path.realpath(executable)
|
|
||||||
with open(executable, 'rb') as f:
|
with open(executable, 'rb') as f:
|
||||||
binary = f.read(chunksize)
|
binary = f.read(chunksize)
|
||||||
pos = 0
|
pos = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue