From dec47c7102cf0aa3a4debf002928db8e460c0d71 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Fri, 5 Mar 2021 23:12:19 +1100 Subject: Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code. --- mediagoblin/plugins/piwigo/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mediagoblin/plugins/piwigo/views.py') diff --git a/mediagoblin/plugins/piwigo/views.py b/mediagoblin/plugins/piwigo/views.py index 30c7ffa2..ecc7054e 100644 --- a/mediagoblin/plugins/piwigo/views.py +++ b/mediagoblin/plugins/piwigo/views.py @@ -121,7 +121,7 @@ def pwg_images_addSimple(request): raise BadRequest() dump = [] for f in form: - dump.append("%s=%r" % (f.name, f.data)) + dump.append("{}={!r}".format(f.name, f.data)) _log.info("addSimple: %r %s %r", request.form, " ".join(dump), request.files) @@ -133,8 +133,8 @@ def pwg_images_addSimple(request): mg_app=request.app, user=request.user, submitted_file=request.files['image'], filename=request.files['image'].filename, - title=six.text_type(form.name.data), - description=six.text_type(form.comment.data)) + title=str(form.name.data), + description=str(form.comment.data)) collection_id = form.category.data if collection_id > 0: @@ -151,7 +151,7 @@ def pwg_images_addSimple(request): # Handle upload limit issues except FileUploadLimit: raise BadRequest( - _(u'Sorry, the file size is too big.')) + _('Sorry, the file size is too big.')) except UserUploadLimit: raise BadRequest( _('Sorry, uploading this file will put you over your' -- cgit v1.2.3