Home GnuPG
Diffusion GPGME e3c5913a33ed

python: Implement the context manager protocol.
e3c5913a33edUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

python: Implement the context manager protocol.

* lang/python/pyme/core.py (Context.__del__): Make function
idemptotent.
(Context.{__enter__,__exit__}): Implement the context manager
protocol.
(Data.__del__): Make function idemptotent, drop debug print.
(Data.{__enter__,__exit__}): Implement the context manager
protocol.
* lang/python/tests/t-idiomatic.py: Demonstrate this.
  • Signed-off-by: Justus Winter <justus@g10code.com>

Details

Provenance
justusAuthored on Jun 7 2016, 7:31 PM
Parents
rMf8f9bf06bc31: python: Fix error handling.
Branches
Unknown
Tags
Unknown

Event Timeline

Justus Winter <justus@g10code.com> committed rMe3c5913a33ed: python: Implement the context manager protocol. (authored by Justus Winter <justus@g10code.com>).Jun 8 2016, 1:44 PM