1
0
forked from pool/osc
osc-fork/bug-378421_osc_cookiejar_fix.diff

22 lines
616 B
Diff

Index: osc/core.py
===================================================================
--- osc/core.py (Revision 3704)
+++ osc/core.py (Arbeitskopie)
@@ -1385,11 +1385,12 @@
raise
- fd = urllib2.urlopen(req, data=data)
+ try:
+ fd = urllib2.urlopen(req, data=data)
+ finally:
+ if hasattr(conf.cookiejar, 'save'):
+ conf.cookiejar.save(ignore_discard=True)
- if hasattr(conf.cookiejar, 'save'):
- conf.cookiejar.save(ignore_discard=True)
-
if filefd: filefd.close()
# this code is for debugging empty responses from api.opensuse.org