# HG changeset patch # User Patrick Mezard # Date 1206049300 -3600 # Node ID 4e836769d93cdbfc974c07886ebcff00b419fc83 # Parent 3f754be7abbb8b732cacc2a8213d53a34ae22676 util: test fileno() availability in win32 set_binary() Fix suggested by Alexander Belchenko diff -r 3f754be7abbb -r 4e836769d93c mercurial/util.py --- a/mercurial/util.py Thu Mar 20 15:59:54 2008 -0500 +++ b/mercurial/util.py Thu Mar 20 22:41:40 2008 +0100 @@ -1000,7 +1000,8 @@ pass def set_binary(fd): - msvcrt.setmode(fd.fileno(), os.O_BINARY) + if hasattr(fd, 'fileno'): + msvcrt.setmode(fd.fileno(), os.O_BINARY) def pconvert(path): return '/'.join(splitpath(path))