Author: mattip <[email protected]>
Branch: win32-stdlib
Changeset: r55561:a5d3b370bcbc
Date: 2012-06-10 18:41 +0300
http://bitbucket.org/pypy/pypy/changeset/a5d3b370bcbc/
Log: isatty should not raise exception
diff --git a/pypy/rpython/module/ll_os.py b/pypy/rpython/module/ll_os.py
--- a/pypy/rpython/module/ll_os.py
+++ b/pypy/rpython/module/ll_os.py
@@ -1362,7 +1362,8 @@
os_isatty = self.llexternal(underscore_on_windows+'isatty',
[rffi.INT], rffi.INT)
def isatty_llimpl(fd):
- rposix.validate_fd(fd)
+ if not rposix.is_valid_fd(fd):
+ return False
res = rffi.cast(lltype.Signed, os_isatty(rffi.cast(rffi.INT, fd)))
return res != 0
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit