mfenniak / pg8000

A Pure-Python PostgreSQL Driver
http://pythonhosted.org/pg8000/
Other
222 stars 55 forks source link

Connection should support __enter__ and __exit__ #170

Closed seushermsft closed 5 years ago

seushermsft commented 5 years ago

Cursor already supports this and allows for using the with keyword, but Connection doesn't so you have to fall back to using try-finally with checks to see if the connection object was properly initialized.

seushermsft commented 5 years ago

@tlocke (you seem to be most active) - Is there a process to follow for commits in the repro, and any tips to get the current set of tests succeeding? My local run of master fails with the same errors CircleCI is and I don't know if that is a known issue, or a coincidence. - Thanks

tlocke commented 5 years ago

Hi @seushermsft, I've used this patch and it'll be in the next release. We went through a bit of confusion with moving from CircleCI to Travis, and moving the repository to https://github.com/tlocke/pg8000/, but everything should be working now.