diff options
author | Ben Sturmfels <ben@sturm.com.au> | 2021-03-05 23:12:19 +1100 |
---|---|---|
committer | Ben Sturmfels <ben@sturm.com.au> | 2021-03-05 23:12:19 +1100 |
commit | dec47c7102cf0aa3a4debf002928db8e460c0d71 (patch) | |
tree | 47631fc15c7af172aa699506adf3d76d3a71976c /mediagoblin/plugins/piwigo/tools.py | |
parent | 5f3a782fef4855e10b7259624a14d8afb0f7be93 (diff) | |
download | mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.lz mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.xz mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.zip |
Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.
Diffstat (limited to 'mediagoblin/plugins/piwigo/tools.py')
-rw-r--r-- | mediagoblin/plugins/piwigo/tools.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mediagoblin/plugins/piwigo/tools.py b/mediagoblin/plugins/piwigo/tools.py index 7b9b7af3..7b3e931a 100644 --- a/mediagoblin/plugins/piwigo/tools.py +++ b/mediagoblin/plugins/piwigo/tools.py @@ -47,9 +47,9 @@ class PwgNamedArray(list): def _fill_element_dict(el, data, as_attr=()): - for k, v in six.iteritems(data): + for k, v in data.items(): if k in as_attr: - if not isinstance(v, six.string_types): + if not isinstance(v, str): v = str(v) el.set(k, v) else: @@ -63,7 +63,7 @@ def _fill_element(el, data): el.text = "1" else: el.text = "0" - elif isinstance(data, six.string_types): + elif isinstance(data, str): el.text = data elif isinstance(data, int): el.text = str(data) @@ -92,7 +92,7 @@ def response_xml(result): mimetype='text/xml', status=status) -class CmdTable(object): +class CmdTable: _cmd_table = {} def __init__(self, cmd_name, only_post=False): @@ -131,11 +131,11 @@ def check_form(form): raise BadRequest() dump = [] for f in form: - dump.append("%s=%r" % (f.name, f.data)) + dump.append("{}={!r}".format(f.name, f.data)) _log.debug("form: %s", " ".join(dump)) -class PWGSession(object): +class PWGSession: session_manager = None def __init__(self, request): |