← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:six-moves-http-cookiejar into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:six-moves-http-cookiejar into launchpad:master.

Commit message:
Import from six.moves.http_cookiejar rather than cookielib

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/380386
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:six-moves-http-cookiejar into launchpad:master.
diff --git a/lib/lp/scripts/utilities/importpedant.py b/lib/lp/scripts/utilities/importpedant.py
index c7859a4..fa583fe 100644
--- a/lib/lp/scripts/utilities/importpedant.py
+++ b/lib/lp/scripts/utilities/importpedant.py
@@ -29,7 +29,6 @@ def text_lines_to_set(text):
 valid_imports_not_in_all = {
     # Exported in Python 3, but missing and so not exported in Python 2.
     'contextlib': set(['ExitStack']),
-    'cookielib': set(['domain_match']),
     # Exported in Python 3, but missing and so not exported in Python 2.
     'json.decoder': set(['JSONDecodeError']),
     'openid.fetchers': set(['Urllib2Fetcher']),
@@ -38,6 +37,7 @@ valid_imports_not_in_all = {
     'pipes': set(['quote']),
     # Exported in Python 3, but missing and so not exported in Python 2.
     'shlex': set(['quote']),
+    'six.moves.http_cookiejar': set(['domain_match']),
     'storm.database': set(['STATE_DISCONNECTED']),
     'textwrap': set(['dedent']),
     'testtools.testresult.real': set(['_details_to_str']),
diff --git a/lib/lp/services/webapp/session.py b/lib/lp/services/webapp/session.py
index 2861dec..6bd4212 100644
--- a/lib/lp/services/webapp/session.py
+++ b/lib/lp/services/webapp/session.py
@@ -5,9 +5,8 @@
 
 __metaclass__ = type
 
-from cookielib import domain_match
-
 from lazr.uri import URI
+from six.moves.http_cookiejar import domain_match
 from zope.session.http import CookieClientIdManager
 
 from lp.services.config import config
diff --git a/utilities/paste b/utilities/paste
index e2c630e..df1099b 100755
--- a/utilities/paste
+++ b/utilities/paste
@@ -6,10 +6,6 @@
 import _pythonpath
 
 import base64
-from cookielib import (
-    Cookie,
-    CookieJar,
-    )
 from optparse import OptionParser
 import os
 import pwd
@@ -17,6 +13,10 @@ import sys
 import webbrowser
 
 from fixtures import MonkeyPatch
+from six.moves.http_cookiejar import (
+    Cookie,
+    CookieJar,
+    )
 from six.moves.urllib.parse import urljoin
 from zope.testbrowser.browser import Browser