summaryrefslogtreecommitdiffstats
path: root/Lib/cookielib.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-12-23 21:24:35 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-12-23 21:24:35 (GMT)
commit3e7de59bd2ac22f677f3a053ade22f44785f15f4 (patch)
treeb2f803ac772da9e4be5ff0087b2d783c77ded54e /Lib/cookielib.py
parentb164dafebb6b73eccdf0ced74c23e8896786b456 (diff)
downloadcpython-3e7de59bd2ac22f677f3a053ade22f44785f15f4.zip
cpython-3e7de59bd2ac22f677f3a053ade22f44785f15f4.tar.gz
cpython-3e7de59bd2ac22f677f3a053ade22f44785f15f4.tar.bz2
Fix SF #1117398, cookielib LWPCookieJar and MozillaCookieJar exceptions
cookielib.LWPCookieJar and .MozillaCookieJar are documented to raise cookielib.LoadError on attempt to load an invalid cookies file, but raise IOError instead. Compromise by having LoadError subclass IOError.
Diffstat (limited to 'Lib/cookielib.py')
-rw-r--r--Lib/cookielib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/cookielib.py b/Lib/cookielib.py
index f774cdf..656ae39 100644
--- a/Lib/cookielib.py
+++ b/Lib/cookielib.py
@@ -1682,7 +1682,8 @@ class CookieJar:
return "<%s[%s]>" % (self.__class__, ", ".join(r))
-class LoadError(Exception): pass
+# derives from IOError for backwards-compatibility with Python 2.4.0
+class LoadError(IOError): pass
class FileCookieJar(CookieJar):
"""CookieJar that can be loaded from and saved to a file."""