From: Dmitry Selyutin Date: Sun, 22 Oct 2017 20:46:08 +0000 (+0300) Subject: vfs: base VFS __enter__ and __exit__ methods X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b67345cb1eba5bd7c5160c2373b6dc5d938fa3b8;p=thirdparty%2Fgnulib.git vfs: base VFS __enter__ and __exit__ methods --- diff --git a/pygnulib/vfs.py b/pygnulib/vfs.py index f1e413c8de..8b0c29ac48 100644 --- a/pygnulib/vfs.py +++ b/pygnulib/vfs.py @@ -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)