8000 Remove compatibility check for Python versions below 2.2. (GH-28314) · python/cpython@778b075 · GitHub
[go: up one dir, main page]

Skip to content

Commit 778b075

Browse files
Omer Katzambv
andauthored
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>
1 parent 54a1760 commit 778b075

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Lib/platform.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,10 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384):
187187
executable = sys.executable
188188

189189
V = _comparable_version
190-
if hasattr(os.path, 'realpath'):
191-
# Python 2.2 introduced os.path.realpath(); it is used
192-
# here to work around problems with Cygwin not being
193-
# able to open symlinks for reading
194-
executable = os.path.realpath(executable)
190+
# We use os.path.realpath()
191+
# here to work around problems with Cygwin not being
192+
# able to open symlinks for reading
193+
executable = os.path.realpath(executable)
195194
with open(executable, 'rb') as f:
196195
binary = f.read(chunksize)
197196
pos = 0

0 commit comments

Comments
 (0)
0