parseindex: implement context manager method on the wrapper
authorBoris Feld <boris.feld@octobus.net>
Tue, 06 Feb 2018 12:25:11 +0100
changeset 35966 8140ce44dec4
parent 35965 c839bbee1e13
child 35967 61326dd7cb8d
parseindex: implement context manager method on the wrapper This is needed for incoming cleanups.
tests/test-parseindex.t
--- a/tests/test-parseindex.t	Tue Feb 06 11:52:37 2018 +0100
+++ b/tests/test-parseindex.t	Tue Feb 06 12:25:11 2018 +0100
@@ -41,6 +41,13 @@
   >     def __getattr__(self, key):
   >         return getattr(self.real, key)
   > 
+  >     def __enter__(self):
+  >         self.real.__enter__()
+  >         return self
+  > 
+  >     def __exit__(self, *args, **kwargs):
+  >         return self.real.__exit__(*args, **kwargs)
+  > 
   > def opener(*args):
   >     o = vfs.vfs(*args)
   >     def wrapper(*a, **kwargs):