summaryrefslogtreecommitdiffstats
path: root/cython/afc.pxi
diff options
context:
space:
mode:
Diffstat (limited to 'cython/afc.pxi')
-rw-r--r--cython/afc.pxi6
1 files changed, 6 insertions, 0 deletions
diff --git a/cython/afc.pxi b/cython/afc.pxi
index 6df9b45..1d3b366 100644
--- a/cython/afc.pxi
+++ b/cython/afc.pxi
@@ -116,6 +116,12 @@ cdef class AfcFile(Base):
116 def __init__(self, *args, **kwargs): 116 def __init__(self, *args, **kwargs):
117 raise TypeError("AfcFile cannot be instantiated") 117 raise TypeError("AfcFile cannot be instantiated")
118 118
119 def __enter__(self):
120 return self
121
122 def __exit__(self, type, value, traceback):
123 self.close()
124
119 cpdef close(self): 125 cpdef close(self):
120 self.handle_error(afc_file_close(self._client._c_client, self._c_handle)) 126 self.handle_error(afc_file_close(self._client._c_client, self._c_handle))
121 127