Patchwork [5,of,8,py3] bugzilla: use util.urlreq.urlparse

login
register
mail settings
Submitter Gregory Szorc
Date March 22, 2017, 5:56 a.m.
Message ID <89b99d4557cec1e24d0f.1490162202@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/19553/
State Accepted
Headers show

Comments

Gregory Szorc - March 22, 2017, 5:56 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1490161192 25200
#      Tue Mar 21 22:39:52 2017 -0700
# Node ID 89b99d4557cec1e24d0f11426c966bb4e548e1f0
# Parent  0082c745f5a97449d8a0f9e3bf00db1ebdacedde
bugzilla: use util.urlreq.urlparse

And stop saving a module variable because it shouldn't be
necessary.

Patch

diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py
--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -307,7 +307,6 @@  from mercurial import (
     util,
 )
 
-urlparse = util.urlparse
 xmlrpclib = util.xmlrpclib
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
@@ -657,7 +656,7 @@  class bzxmlrpc(bzaccess):
         self.bztoken = login.get('token', '')
 
     def transport(self, uri):
-        if urlparse.urlparse(uri, "http")[0] == "https":
+        if util.urlreq.urlparse(uri, "http")[0] == "https":
             return cookiesafetransport()
         else:
             return cookietransport()