Dolda2000 GitWeb
/
fulbank.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3851cd1
)
fsb: Work around cookie processors no longer being pickleable.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 13 Nov 2020 21:19:27 +0000
(22:19 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 13 Nov 2020 21:19:27 +0000
(22:19 +0100)
fulbank/fsb.py
patch
|
blob
|
blame
|
history
diff --git
a/fulbank/fsb.py
b/fulbank/fsb.py
index
145de7b
..
8f6280c
100644
(file)
--- a/
fulbank/fsb.py
+++ b/
fulbank/fsb.py
@@
-289,6
+289,18
@@
class session(object):
self.logout()
self._req("v5/framework/clientsession", method="DELETE")
+ def __getstate__(self):
+ state = dict(self.__dict__)
+ state["jar"] = list(state["jar"].cookiejar)
+ return state
+
+ def __setstate__(self, state):
+ jar = request.HTTPCookieProcessor()
+ for cookie in state["jar"]:
+ jar.cookiejar.set_cookie(cookie)
+ state["jar"] = jar
+ self.__dict__.update(state)
+
def __enter__(self):
return self