Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 6330:4e836769d93c
util: test fileno() availability in win32 set_binary()
Fix suggested by Alexander Belchenko <bialix@ukr.net>
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 20 Mar 2008 22:41:40 +0100 |
parents | b0d937869417 |
children | ed9b07a97587 |
comparison
equal
deleted
inserted
replaced
6329:3f754be7abbb | 6330:4e836769d93c |
---|---|
998 | 998 |
999 def set_flags(f, flags): | 999 def set_flags(f, flags): |
1000 pass | 1000 pass |
1001 | 1001 |
1002 def set_binary(fd): | 1002 def set_binary(fd): |
1003 msvcrt.setmode(fd.fileno(), os.O_BINARY) | 1003 if hasattr(fd, 'fileno'): |
1004 msvcrt.setmode(fd.fileno(), os.O_BINARY) | |
1004 | 1005 |
1005 def pconvert(path): | 1006 def pconvert(path): |
1006 return '/'.join(splitpath(path)) | 1007 return '/'.join(splitpath(path)) |
1007 | 1008 |
1008 def localpath(path): | 1009 def localpath(path): |