Sfoglia il codice sorgente

add closed property

zhzhenqin 9 anni fa
parent
commit
12f53e6a32
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      python/IntHeaderProtobufFile.py

+ 3 - 1
python/IntHeaderProtobufFile.py

@@ -62,10 +62,12 @@ class Writer(object):
 
     def close(self):
         self.f.close()
-       
+    
     def isclosed(self):
         return self.f.closed
 
+    closed = property(isclosed)
+
     def __exit__(self, exc_type, exc_val, exc_tb):
         self.close()