##// END OF EJS Templates
util: check fileno() validity in win32 set_binary()
Patrick Mezard -
r6339:ed9b07a9 default
parent child Browse files
Show More
@@ -1000,7 +1000,9 b" if os.name == 'nt':"
1000 pass
1000 pass
1001
1001
1002 def set_binary(fd):
1002 def set_binary(fd):
1003 if hasattr(fd, 'fileno'):
1003 # When run without console, pipes may expose invalid
1004 # fileno(), usually set to -1.
1005 if hasattr(fd, 'fileno') and fd.fileno() >= 0:
1004 msvcrt.setmode(fd.fileno(), os.O_BINARY)
1006 msvcrt.setmode(fd.fileno(), os.O_BINARY)
1005
1007
1006 def pconvert(path):
1008 def pconvert(path):
General Comments 0
You need to be logged in to leave comments. Login now