diff hgext/largefiles/remotestore.py @ 28883:032c4c2f802a

pycompat: switch to util.urlreq/util.urlerr for py3 compat
author timeless <timeless@mozdev.org>
date Wed, 06 Apr 2016 23:22:12 +0000
parents 3be2e89c5d9f
children 207c0db08953
line wrap: on
line diff
--- a/hgext/largefiles/remotestore.py	Thu Apr 07 00:05:48 2016 +0000
+++ b/hgext/largefiles/remotestore.py	Wed Apr 06 23:22:12 2016 +0000
@@ -6,11 +6,12 @@
 
 '''remote largefile store; the base class for wirestore'''
 
-import urllib2
-
 from mercurial import util, wireproto, error
 from mercurial.i18n import _
 
+urlerr = util.urlerr
+urlreq = util.urlreq
+
 import lfutil
 import basestore
 
@@ -49,11 +50,11 @@
     def _getfile(self, tmpfile, filename, hash):
         try:
             chunks = self._get(hash)
-        except urllib2.HTTPError as e:
+        except urlerr.httperror as e:
             # 401s get converted to error.Aborts; everything else is fine being
             # turned into a StoreError
             raise basestore.StoreError(filename, hash, self.url, str(e))
-        except urllib2.URLError as e:
+        except urlerr.urlerror as e:
             # This usually indicates a connection problem, so don't
             # keep trying with the other files... they will probably
             # all fail too.