Merge "Python3: use six.moves.urllib.parse.quote instead of urllib.quote"
This commit is contained in:
@@ -34,11 +34,11 @@ This WSGI component:
|
||||
"""
|
||||
|
||||
import logging
|
||||
import urllib
|
||||
import webob
|
||||
|
||||
import requests
|
||||
import six
|
||||
from six.moves import urllib
|
||||
|
||||
from keystoneclient.openstack.common import jsonutils
|
||||
|
||||
@@ -78,7 +78,7 @@ def split_path(path, minsegs=1, maxsegs=None, rest_with_last=False):
|
||||
count = len(segs)
|
||||
if (segs[0] or count < minsegs or count > maxsegs or
|
||||
'' in segs[1:minsegs]):
|
||||
raise ValueError('Invalid path: %s' % urllib.quote(path))
|
||||
raise ValueError('Invalid path: %s' % urllib.parse.quote(path))
|
||||
else:
|
||||
minsegs += 1
|
||||
maxsegs += 1
|
||||
@@ -87,7 +87,7 @@ def split_path(path, minsegs=1, maxsegs=None, rest_with_last=False):
|
||||
if (segs[0] or count < minsegs or count > maxsegs + 1 or
|
||||
'' in segs[1:minsegs] or
|
||||
(count == maxsegs + 1 and segs[maxsegs])):
|
||||
raise ValueError('Invalid path: %s' % urllib.quote(path))
|
||||
raise ValueError('Invalid path: %s' % urllib.parse.quote(path))
|
||||
segs = segs[1:maxsegs]
|
||||
segs.extend([None] * (maxsegs - 1 - len(segs)))
|
||||
return segs
|
||||
|
Reference in New Issue
Block a user