File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 8
8
import sys
9
9
import subprocess
10
10
11
+ PY3 = bytes != str
12
+
11
13
# Below IsCygwin() function copied from pylib/gyp/common.py
12
14
def IsCygwin ():
13
15
try :
14
16
out = subprocess .Popen ("uname" ,
15
17
stdout = subprocess .PIPE ,
16
18
stderr = subprocess .STDOUT )
17
- stdout ,stderr = out .communicate ()
19
+ stdout , stderr = out .communicate ()
20
+ if PY3 :
21
+ stdout = stdout .decode ("utf-8" )
18
22
return "CYGWIN" in str (stdout )
19
23
except Exception :
20
24
return False
@@ -27,7 +31,9 @@ def UnixifyPath(path):
27
31
out = subprocess .Popen (["cygpath" , "-u" , path ],
28
32
stdout = subprocess .PIPE ,
29
33
stderr = subprocess .STDOUT )
30
- stdout ,stderr = out .communicate ()
34
+ stdout , stderr = out .communicate ()
35
+ if PY3 :
36
+ stdout = stdout .decode ("utf-8" )
31
37
return str (stdout )
32
38
except Exception :
33
39
return path
Original file line number Diff line number Diff line change 11
11
import sys
12
12
import subprocess
13
13
14
+ PY3 = bytes != str
15
+
14
16
15
17
# A minimal memoizing decorator. It'll blow up if the args aren't immutable,
16
18
# among other "problems".
@@ -623,7 +625,9 @@ def IsCygwin():
623
625
out = subprocess .Popen ("uname" ,
624
626
stdout = subprocess .PIPE ,
625
627
stderr = subprocess .STDOUT )
626
- stdout ,stderr = out .communicate ()
628
+ stdout , stderr = out .communicate ()
629
+ if PY3 :
630
+ stdout = stdout .decode ("utf-8" )
627
631
return "CYGWIN" in str (stdout )
628
632
except Exception :
629
633
return False
You can’t perform that action at this time.
0 commit comments