util: make cookielib module available
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 09 Mar 2017 21:35:21 -0800
changeset 31934 12aca6770046
parent 31933 b2478a996a82
child 31935 566cb89050b7
util: make cookielib module available In preparation for supporting sending cookies on HTTP requests.
mercurial/pycompat.py
mercurial/util.py
--- a/mercurial/pycompat.py	Thu Apr 06 11:28:25 2017 +0200
+++ b/mercurial/pycompat.py	Thu Mar 09 21:35:21 2017 -0800
@@ -18,12 +18,14 @@
 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
--- a/mercurial/util.py	Thu Apr 06 11:28:25 2017 +0200
+++ b/mercurial/util.py	Thu Mar 09 21:35:21 2017 -0800
@@ -49,6 +49,7 @@
     pycompat,
 )
 
+cookielib = pycompat.cookielib
 empty = pycompat.empty
 httplib = pycompat.httplib
 httpserver = pycompat.httpserver