Python: Add VFS.fromEmpty utility

This commit is contained in:
Vicki Pfau 2020-08-24 01:59:28 -07:00
parent c7d50956b3
commit 7020ea35a3
1 changed files with 4 additions and 0 deletions

View File

@ -115,6 +115,10 @@ class VFile:
self._no_gc = _no_gc self._no_gc = _no_gc
self._claimed = False self._claimed = False
@staticmethod
def fromEmpty():
return VFile(lib.VFileMemChunk(ffi.NULL, 0))
def __del__(self): def __del__(self):
if not self._claimed: if not self._claimed:
self.close() self.close()