Patchwork [1,of,3,V2] util: make cookielib module available

login
register
mail settings
Submitter Gregory Szorc
Date March 29, 2017, 3 a.m.
Message ID <011f4e38687438d27341.1490756448@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/19806/
State Accepted
Headers show

Comments

Gregory Szorc - March 29, 2017, 3 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1489124121 28800
#      Thu Mar 09 21:35:21 2017 -0800
# Node ID 011f4e38687438d273410faf7b960845e4e0b735
# Parent  e86eb75e74ce1b0803c26d86a229b9b711f6d76a
util: make cookielib module available

In preparation for supporting sending cookies on HTTP requests.

Patch

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -18,12 +18,14 @@  import sys
 ispy3 = (sys.version_info[0] >= 3)
 
 if not ispy3:
+    import cookielib
     import cPickle as pickle
     import httplib
     import Queue as _queue
     import SocketServer as socketserver
     import xmlrpclib
 else:
+    import http.cookielib as cookielib
     import http.client as httplib
     import pickle
     import queue as _queue
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -49,6 +49,7 @@  from . import (
     pycompat,
 )
 
+cookielib = pycompat.cookielib
 empty = pycompat.empty
 httplib = pycompat.httplib
 httpserver = pycompat.httpserver