Python 3: use six.iteritems and six.string_types
six.iteritems() replaces dictionary.iteritems() on Python 2 and dictionary.items() on Python 3. six.string_types replaces basestring() in Python 2 and str in Python 3. Change-Id: Ia18510d167df35caec83626718010228e2140bc0
This commit is contained in:
@@ -57,11 +57,11 @@ class Controller(object):
|
||||
tags_url_params = []
|
||||
|
||||
for tag in tags:
|
||||
if isinstance(tag, basestring):
|
||||
if isinstance(tag, six.string_types):
|
||||
tags_url_params.append({'tag': strutils.safe_encode(tag)})
|
||||
|
||||
for param, value in six.iteritems(filters):
|
||||
if isinstance(value, basestring):
|
||||
if isinstance(value, six.string_types):
|
||||
filters[param] = strutils.safe_encode(value)
|
||||
|
||||
url = '/v2/images?%s' % urllib.urlencode(filters)
|
||||
|
||||
Reference in New Issue
Block a user