Keep py3.X compatibility for urllib
Change-Id: If6c1b016c726070b5b326296ead933cbd74bd408 Partial-Bug:#1280105
This commit is contained in:
parent
30784a060e
commit
674e63b853
@ -24,7 +24,6 @@ from .rest import ApiException
|
||||
|
||||
import os
|
||||
import re
|
||||
import urllib
|
||||
import json
|
||||
import mimetypes
|
||||
import random
|
||||
@ -36,13 +35,7 @@ from datetime import date
|
||||
|
||||
# python 2 and python 3 compatibility library
|
||||
from six import iteritems
|
||||
|
||||
try:
|
||||
# for python3
|
||||
from urllib.parse import quote
|
||||
except ImportError:
|
||||
# for python2
|
||||
from urllib import quote
|
||||
from six.moves.urllib import parse as urlparse
|
||||
|
||||
from .configuration import Configuration
|
||||
|
||||
@ -116,7 +109,7 @@ class ApiClient(object):
|
||||
if path_params:
|
||||
path_params = self.sanitize_for_serialization(path_params)
|
||||
for k, v in iteritems(path_params):
|
||||
replacement = quote(str(self.to_path_value(v)))
|
||||
replacement = urlparse.quote(str(self.to_path_value(v)))
|
||||
resource_path = resource_path.\
|
||||
replace('{' + k + '}', replacement)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user