diff --git a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js b/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js index 752dcad7bf2..afb6b66c256 100644 --- a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js +++ b/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js @@ -26,13 +26,11 @@ } function addPopupIndex(name) { - name = name + "__" + (popupIndex + 1); - return name; + return name + "__" + (popupIndex + 1); } function removePopupIndex(name) { - name = name.replace(new RegExp("__" + (popupIndex + 1) + "$"), ''); - return name; + return name.replace(new RegExp("__" + (popupIndex + 1) + "$"), ''); } function showAdminPopup(triggeringLink, name_regexp, add_popup) { diff --git a/django/contrib/admin/static/admin/js/urlify.js b/django/contrib/admin/static/admin/js/urlify.js index 61dedb23e98..9fc04094964 100644 --- a/django/contrib/admin/static/admin/js/urlify.js +++ b/django/contrib/admin/static/admin/js/urlify.js @@ -163,8 +163,7 @@ s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens s = s.substring(0, num_chars); // trim to first num_chars chars - s = s.replace(/-+$/g, ''); // trim any trailing hyphens - return s; + return s.replace(/-+$/g, ''); // trim any trailing hyphens } window.URLify = URLify; } diff --git a/django/contrib/gis/geos/polygon.py b/django/contrib/gis/geos/polygon.py index a660adb8d4f..6f76b570050 100644 --- a/django/contrib/gis/geos/polygon.py +++ b/django/contrib/gis/geos/polygon.py @@ -110,8 +110,7 @@ class Polygon(GEOSGeometry): if isinstance(param, LinearRing): return param try: - ring = LinearRing(param) - return ring + return LinearRing(param) except TypeError: raise TypeError(msg) diff --git a/tests/middleware/tests.py b/tests/middleware/tests.py index 63eaa5d28fb..60093503655 100644 --- a/tests/middleware/tests.py +++ b/tests/middleware/tests.py @@ -1027,8 +1027,7 @@ class ETagGZipMiddlewareTest(SimpleTestCase): """ def get_response(req): - response = HttpResponse(self.compressible_string) - return response + return HttpResponse(self.compressible_string) def get_cond_response(req): return ConditionalGetMiddleware(get_response)(req) diff --git a/tests/test_runner/tests.py b/tests/test_runner/tests.py index 30ea4ea670f..c4946c3e58c 100644 --- a/tests/test_runner/tests.py +++ b/tests/test_runner/tests.py @@ -156,8 +156,7 @@ class TestSuiteTests(SimpleTestCase): def make_tests(self): """Return an iterable of tests.""" suite = self.make_test_suite() - tests = list(iter_test_cases(suite)) - return tests + return list(iter_test_cases(suite)) def test_shuffle_tests(self): tests = self.make_tests()