Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 778b075

Browse filesBrowse files
Omer Katzambv
Omer Katz
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
Copy full SHA for 778b075

File tree

1 file changed

+4
-5
lines changed
Filter options

1 file changed

+4
-5
lines changed

‎Lib/platform.py

Copy file name to clipboardExpand all lines: Lib/platform.py
+4-5Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.