From: Dmitry Selyutin Date: Sun, 22 Oct 2017 20:57:55 +0000 (+0300) Subject: module: __enter__ and __exit__ methods X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ba053f4c7d81274b1a52ae68a807742aba3df9e;p=thirdparty%2Fgnulib.git module: __enter__ and __exit__ methods --- diff --git a/pygnulib/module.py b/pygnulib/module.py index 0dc1d4d488..10cc6a42b3 100644 --- a/pygnulib/module.py +++ b/pygnulib/module.py @@ -78,6 +78,14 @@ class Base: return result.strip() + "\n" + def __enter__(self): + return self + + + def __exit__(self, exctype, excval, exctrace): + pass + + def __hash__(self): return hash(tuple(self.__table.items()))