From 26308141eb87300ad49134b977692ebcf50e66c7 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Wed, 6 May 2020 22:59:30 -0700 Subject: Cleanup string formatting --- src/pyramid/config/actions.py | 4 ++-- src/pyramid/config/routes.py | 2 +- src/pyramid/config/views.py | 4 ++-- src/pyramid/csrf.py | 2 +- src/pyramid/renderers.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/pyramid/config/actions.py b/src/pyramid/config/actions.py index 4003a6e3f..b19f35b9b 100644 --- a/src/pyramid/config/actions.py +++ b/src/pyramid/config/actions.py @@ -398,8 +398,8 @@ def resolveConflicts(actions, state=None): # error out if we went backward in order if state.min_order is not None and order < state.min_order: r = [ - 'Actions were added to order={0} after execution had moved ' - 'on to order={1}. Conflicting actions: '.format( + 'Actions were added to order={} after execution had moved ' + 'on to order={}. Conflicting actions: '.format( order, state.min_order ) ] diff --git a/src/pyramid/config/routes.py b/src/pyramid/config/routes.py index 7c78fbfa7..9452a05ab 100644 --- a/src/pyramid/config/routes.py +++ b/src/pyramid/config/routes.py @@ -388,7 +388,7 @@ class RoutesConfiguratorMixin: scheme = parsed.scheme else: scheme = request.scheme - kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc) + kw['_app_url'] = '{}://{}'.format(scheme, parsed.netloc) if original_pregenerator: elements, kw = original_pregenerator(request, elements, kw) diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py index a680eafb3..6faa29d20 100644 --- a/src/pyramid/config/views.py +++ b/src/pyramid/config/views.py @@ -2320,7 +2320,7 @@ class StaticURLInfo: rawspec = None if pkg_name is not None: - pathspec = '{0}:{1}{2}'.format(pkg_name, pkg_subpath, subpath) + pathspec = '{}:{}{}'.format(pkg_name, pkg_subpath, subpath) overrides = registry.queryUtility(IPackageOverrides, name=pkg_name) if overrides is not None: resource_name = posixpath.join(pkg_subpath, subpath) @@ -2328,7 +2328,7 @@ class StaticURLInfo: for source, filtered_path in sources: rawspec = source.get_path(filtered_path) if hasattr(source, 'pkg_name'): - rawspec = '{0}:{1}'.format(source.pkg_name, rawspec) + rawspec = '{}:{}'.format(source.pkg_name, rawspec) break else: diff --git a/src/pyramid/csrf.py b/src/pyramid/csrf.py index 8e711c9a7..4c3689714 100644 --- a/src/pyramid/csrf.py +++ b/src/pyramid/csrf.py @@ -360,6 +360,6 @@ def check_csrf_origin( if not any( is_same_domain(originp.netloc, host) for host in trusted_origins ): - return _fail("{0} does not match any trusted origins.".format(origin)) + return _fail("{} does not match any trusted origins.".format(origin)) return True diff --git a/src/pyramid/renderers.py b/src/pyramid/renderers.py index b17c7d64d..8da6270c3 100644 --- a/src/pyramid/renderers.py +++ b/src/pyramid/renderers.py @@ -387,7 +387,7 @@ class JSONP(JSON): ) ct = 'application/javascript' - body = '/**/{0}({1});'.format(callback, val) + body = '/**/{}({});'.format(callback, val) response = request.response if response.content_type == response.default_content_type: response.content_type = ct -- cgit v1.2.3