hgext/factotum.py
changeset 28971 bacca31f4835
parent 26587 56b2bcea2529
child 29377 2c019aac6b99
--- a/hgext/factotum.py	Sun Apr 17 02:15:05 2016 +0530
+++ b/hgext/factotum.py	Sun Apr 17 02:29:33 2016 +0530
@@ -45,10 +45,19 @@
 
 '''
 
+from __future__ import absolute_import
+
+import os
 from mercurial.i18n import _
-from mercurial.url import passwordmgr
-from mercurial import httpconnection, error
-import os, urllib2
+from mercurial import (
+    error,
+    httpconnection,
+    url,
+    util,
+)
+
+urlreq = util.urlreq
+passwordmgr = url.passwordmgr
 
 ERRMAX = 128
 
@@ -93,7 +102,7 @@
 
 @monkeypatch_method(passwordmgr)
 def find_user_password(self, realm, authuri):
-    user, passwd = urllib2.HTTPPasswordMgrWithDefaultRealm.find_user_password(
+    user, passwd = urlreq.httppasswordmgrwithdefaultrealm.find_user_password(
         self, realm, authuri)
     if user and passwd:
         self._writedebug(user, passwd)