changeset 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 3f754be7abbb
children 627665e37bdd
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))