##// END OF EJS Templates
windows: use getattr instead of hasattr
Augie Fackler -
r14969:a3f97038 default
parent child Browse files
Show More
@@ -99,8 +99,9 b' def checklink(path):'
99 def setbinary(fd):
99 def setbinary(fd):
100 # When run without console, pipes may expose invalid
100 # When run without console, pipes may expose invalid
101 # fileno(), usually set to -1.
101 # fileno(), usually set to -1.
102 if hasattr(fd, 'fileno') and fd.fileno() >= 0:
102 fno = getattr(fd, 'fileno', None)
103 msvcrt.setmode(fd.fileno(), os.O_BINARY)
103 if fno is not None and fno() >= 0:
104 msvcrt.setmode(fno(), os.O_BINARY)
104
105
105 def pconvert(path):
106 def pconvert(path):
106 return '/'.join(path.split(os.sep))
107 return '/'.join(path.split(os.sep))
General Comments 0
You need to be logged in to leave comments. Login now