python 3 urllib

This commit is contained in:
Friedrich Lindenberg
2016-02-14 11:19:19 +01:00
parent 0dbb926dec
commit dcf1e09bbe
+5 -2
View File
@@ -1,5 +1,8 @@
from datetime import datetime
import urlparse
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
try:
from collections import OrderedDict
@@ -81,7 +84,7 @@ class ResultIter(object):
def safe_url(url):
""" Remove password from printed connection URLs. """
parsed = urlparse.urlparse(url)
parsed = urlparse(url)
if parsed.password is not None:
pwd = ':%s@' % parsed.password
url = url.replace(pwd, ':*****@')