File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import sys
99import subprocess
1010
11+ PY3 = bytes != str
12+
1113# Below IsCygwin() function copied from pylib/gyp/common.py
1214def IsCygwin ():
1315 try :
1416 out = subprocess .Popen ("uname" ,
1517 stdout = subprocess .PIPE ,
1618 stderr = subprocess .STDOUT )
17- stdout ,stderr = out .communicate ()
19+ stdout , stderr = out .communicate ()
20+ if PY3 :
21+ stdout = stdout .decode ("utf-8" )
1822 return "CYGWIN" in str (stdout )
1923 except Exception :
2024 return False
@@ -27,7 +31,9 @@ def UnixifyPath(path):
2731 out = subprocess .Popen (["cygpath" , "-u" , path ],
2832 stdout = subprocess .PIPE ,
2933 stderr = subprocess .STDOUT )
30- stdout ,stderr = out .communicate ()
34+ stdout , stderr = out .communicate ()
35+ if PY3 :
36+ stdout = stdout .decode ("utf-8" )
3137 return str (stdout )
3238 except Exception :
3339 return path
Original file line number Diff line number Diff line change 1111import sys
1212import subprocess
1313
14+ PY3 = bytes != str
15+
1416
1517# A minimal memoizing decorator. It'll blow up if the args aren't immutable,
1618# among other "problems".
@@ -623,7 +625,9 @@ def IsCygwin():
623625 out = subprocess .Popen ("uname" ,
624626 stdout = subprocess .PIPE ,
625627 stderr = subprocess .STDOUT )
626- stdout ,stderr = out .communicate ()
628+ stdout , stderr = out .communicate ()
629+ if PY3 :
630+ stdout = stdout .decode ("utf-8" )
627631 return "CYGWIN" in str (stdout )
628632 except Exception :
629633 return False
You can’t perform that action at this time.
0 commit comments