Author: Bystroushaak <[email protected]>
Branch: feature_closed_prop_to_rfile
Changeset: r97034:5f379993c867
Date: 2019-07-09 17:26 +0200
http://bitbucket.org/pypy/pypy/changeset/5f379993c867/

Log:    RFile; added property .closed to mirror standard `file` behaviour.

diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -312,6 +312,10 @@
         if not self._ll_file:
             raise ValueError("I/O operation on closed file")
 
+    @property
+    def closed(self):
+        return not self._ll_file
+
     def _fread(self, buf, n, stream):
         if not self._univ_newline:
             return c_fread(buf, 1, n, stream)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to