Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 989835c

Browse files
committed
Patch #103220 from Jason Tishler:
This patch adds support for Cygwin to util.get_platform(). A Cygwin specific case is needed due to the format of Cygwin's uname command, which contains '/' characters.
1 parent ae89af9 commit 989835c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/distutils/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ def get_platform ():
5454
# fall through to standard osname-release-machine representation
5555
elif osname[:4] == "irix": # could be "irix64"!
5656
return "%s-%s" % (osname, release)
57+
elif osname[:6] == "cygwin":
58+
rel_re = re.compile (r'[\d.]+')
59+
m = rel_re.match(release)
60+
if m:
61+
release = m.group()
5762

5863
return "%s-%s-%s" % (osname, release, machine)
5964

0 commit comments

Comments
 (0)