diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-08-11 07:02:28 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-08-11 07:02:28 +0100 |
commit | 068424b26532f3551a81421a9be67ed206e5c11a (patch) | |
tree | 583b8d979899a463a4ef5b26d3d49e85df987623 /dev-python/mechanize/files | |
parent | d162ba1860a88062f4cd61f8b52fc303ba0b2991 (diff) |
gentoo resync : 11.08.2021
Diffstat (limited to 'dev-python/mechanize/files')
-rw-r--r-- | dev-python/mechanize/files/mechanize-0.4.5-py310.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/dev-python/mechanize/files/mechanize-0.4.5-py310.patch b/dev-python/mechanize/files/mechanize-0.4.5-py310.patch new file mode 100644 index 000000000000..98656b65425f --- /dev/null +++ b/dev-python/mechanize/files/mechanize-0.4.5-py310.patch @@ -0,0 +1,28 @@ +diff --git a/mechanize/_clientcookie.py b/mechanize/_clientcookie.py +index ebd2773..6c89cbf 100644 +--- a/mechanize/_clientcookie.py ++++ b/mechanize/_clientcookie.py +@@ -188,13 +188,22 @@ class CookieJar(CJ): + raise IndexError() + + ++try: ++ from http.cookiejar import NETSCAPE_MAGIC_RGX, NETSCAPE_HEADER_TEXT ++except ImportError: # python < 3.10 ++ NETSCAPE_MAGIC_RGX = MCJ.magic_re ++ NETSCAPE_HEADER_TEXT = MCJ.header ++else: ++ MCJ.header = NETSCAPE_HEADER_TEXT # needed for tests ++ ++ + class MozillaCookieJar(MCJ): + + def _really_load(self, f, filename, ignore_discard, ignore_expires): + now = time.time() + + magic = f.readline() +- if not re.search(self.magic_re, magic): ++ if not re.search(NETSCAPE_MAGIC_RGX, magic): + f.close() + raise LoadError( + "%r does not look like a Netscape format cookies file" % |