A possible fix for #1036

I can only assume that the only possible thing to close on a session are the
adapters. As such, I wrote the close method for a session object which closes
all possible adapters.
This commit is contained in:
Ian Cordasco
2012-12-18 09:43:55 -05:00
parent 6acce57271
commit 14da5cf180
+6 -1
View File
@@ -365,7 +365,12 @@ class Session(SessionRedirectMixin):
return adapter
# Nothing matches :-/
raise InvalidSchema('No connection adapters were found for \'%s\'' % url)
raise InvalidSchema("No connection adapters were found for '%s'" % url)
def close(self):
"""Closes all adapters and as such the session"""
for _, v in self.adapters.items():
v.close()
def mount(self, prefix, adapter):
"""Registers a connection adapter to a prefix."""