Closed ifduyue closed 9 years ago
__enter__ and __exit__ are helpful, but were added after v0.4.0
__enter__
__exit__
To achieve the same goal without touching beanstalkc code:
import beanstalkc import contextlib with contextlib.closing(beanstalkc.Connection()) as beanstalk: '''work...'''
__enter__
and__exit__
are helpful, but were added after v0.4.0