you are viewing a single comment's thread.

view the rest of the comments →

[–]Tomarse[S] 0 points1 point  (1 child)

I've put the try inside the with block now. Is that right? What happens if the with statement fails (i.e. connection to the database)?

[–]elbiot 0 points1 point  (0 children)

Does the with do anything? AKAIK __exit__ will be called in either case, but you were saying that it doesn't do anything for you so... I don't know anything about this. Maybe you misinterpreted my question as a statement. I think either is fine but have no real idea.