Show More
@@ -333,6 +333,14 b' class transaction(object):' | |||
|
333 | 333 | if self.count > 0 and self.usages == 0: |
|
334 | 334 | self._abort() |
|
335 | 335 | |
|
336 | def __enter__(self): | |
|
337 | return self | |
|
338 | ||
|
339 | def __exit__(self, exc_type, exc_val, exc_tb): | |
|
340 | if exc_type is None: | |
|
341 | self.close() | |
|
342 | self.release() | |
|
343 | ||
|
336 | 344 | def running(self): |
|
337 | 345 | return self.count > 0 |
|
338 | 346 |
General Comments 0
You need to be logged in to leave comments.
Login now