Re: (any)dbm module lacks a context manager

2013-01-31 Thread Terry Reedy
On 1/31/2013 2:03 PM, python.l...@tim.thechases.com wrote: I don't know if this has been remedied in a more recent version than I've got on my box (Debian Stable), but it seems like it should work out of the box: Python 3.1.3 (r313:86834, Nov 28 2010, 10:01:07) [GCC 4.4.5] on linux2 Type "help",

RE: (any)dbm module lacks a context manager

2013-01-31 Thread Nick Cash
> >>> import dbm > >>> with dbm.open("mydb", 'c') as d: > ... d["hello"] = "world" > ... > Traceback (most recent call last): > File "", line 1, in > AttributeError: '_dbm.dbm' object has no attribute '__exit__' This error message is somewhat misleading... it actually means you're trying to