__enter__ return self

enables 'with X as Y' syntax
This commit is contained in:
Michael Davidsaver
2014-02-26 09:51:42 -05:00
parent 2f33de5c39
commit c947b185ce

View File

@ -273,7 +273,8 @@ static PyObject *pyRecord_enter(pyRecord *self)
{
dbScanLock(self->entry.precnode->precord);
Py_RETURN_NONE;
Py_INCREF(self);
return (PyObject*)self;
}
static PyObject *pyRecord_exit(pyRecord *self, PyObject *args)