earl / beanstalkc

A simple beanstalkd client library for Python
Apache License 2.0
458 stars 115 forks source link

Please make a new release #58

Closed ifduyue closed 9 years ago

ifduyue commented 9 years ago

__enter__ and __exit__ are helpful, but were added after v0.4.0

ifduyue commented 9 years ago

To achieve the same goal without touching beanstalkc code:

import beanstalkc
import contextlib

with contextlib.closing(beanstalkc.Connection()) as beanstalk:
    '''work...'''