aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/trim_whitespace/__init__.py
diff options
context:
space:
mode:
authorBen Sturmfels <ben@sturm.com.au>2021-03-05 23:12:19 +1100
committerBen Sturmfels <ben@sturm.com.au>2021-03-05 23:12:19 +1100
commitdec47c7102cf0aa3a4debf002928db8e460c0d71 (patch)
tree47631fc15c7af172aa699506adf3d76d3a71976c /mediagoblin/plugins/trim_whitespace/__init__.py
parent5f3a782fef4855e10b7259624a14d8afb0f7be93 (diff)
downloadmediagoblin-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/trim_whitespace/__init__.py')
-rw-r--r--mediagoblin/plugins/trim_whitespace/__init__.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/mediagoblin/plugins/trim_whitespace/__init__.py b/mediagoblin/plugins/trim_whitespace/__init__.py
index 3da1e8b4..6f67218c 100644
--- a/mediagoblin/plugins/trim_whitespace/__init__.py
+++ b/mediagoblin/plugins/trim_whitespace/__init__.py
@@ -13,7 +13,6 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from __future__ import unicode_literals
import logging
import re
@@ -23,7 +22,7 @@ _log = logging.getLogger(__name__)
class TrimWhiteSpaceMeddleware(meddleware.BaseMeddleware):
_setup_plugin_called = 0
- RE_MULTI_WHITESPACE = re.compile(b'(\s)\s+', re.M)
+ RE_MULTI_WHITESPACE = re.compile(br'(\s)\s+', re.M)
def process_response(self, request, response):
"""Perform very naive html tidying by removing multiple whitespaces"""
@@ -65,7 +64,7 @@ class TrimWhiteSpaceMeddleware(meddleware.BaseMeddleware):
# Append ourselves to the list of enabled Meddlewares
meddleware.ENABLED_MEDDLEWARE.append(
- '{0}:{1}'.format(cls.__module__, cls.__name__))
+ '{}:{}'.format(cls.__module__, cls.__name__))
hooks = {