]> Savannah Git Hosting - gnulib.git/commitdiff
vfs: base VFS __enter__ and __exit__ methods
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 22 Oct 2017 20:46:08 +0000 (23:46 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 22 Oct 2017 20:46:08 +0000 (23:46 +0300)
pygnulib/vfs.py

index f1e413c8de24f17443087a26eb601f62fa8a69d3..8b0c29ac483a63f7415c55e9a4e73bbea1cd609e 100644 (file)
@@ -35,6 +35,14 @@ class Base:
         return "{}.{}{{{}}}".format(module, name, repr(self.__prefix))
 
 
+    def __enter__(self):
+        return self
+
+
+    def __exit__(self, exctype, excval, exctrace):
+        pass
+
+
     def __contains__(self, name):
         path = _os.path.normpath(name)
         if _os.path.isabs(name):
@@ -247,14 +255,6 @@ class GnulibGit(Base):
             raise TypeError("{} is not a gnulib repository".format(prefix))
 
 
-    def __enter__(self):
-        return self
-
-
-    def __exit__(self, exctype, excval, exctrace):
-        pass
-
-
     def module(self, name, full=True):
         """obtain gnulib module by name"""
         _type_assert("name", name, str)