[pypy-commit] pypy default: support rfile.isatty()

bdkearns noreply at buildbot.pypy.org
Wed Sep 10 03:08:48 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r73408:6647fa7b2e68
Date: 2014-09-09 21:00 -0400
http://bitbucket.org/pypy/pypy/changeset/6647fa7b2e68/

Log:	support rfile.isatty()

diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -484,3 +484,7 @@
     def fileno(self):
         self._check_closed()
         return intmask(c_fileno(self._ll_file))
+
+    def isatty(self):
+        self._check_closed()
+        return os.isatty(c_fileno(self._ll_file))
diff --git a/rpython/rlib/test/test_rfile.py b/rpython/rlib/test/test_rfile.py
--- a/rpython/rlib/test/test_rfile.py
+++ b/rpython/rlib/test/test_rfile.py
@@ -279,6 +279,7 @@
 
         def f():
             f = open(fname, "w")
+            assert not f.isatty()
             try:
                 return f.fileno()
             finally:


More information about the pypy-commit mailing list