diff -r 4f86c3bed63b -r bacca31f4835 hgext/factotum.py --- 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)