diff --git a/django/contrib/sitemaps/__init__.py b/django/contrib/sitemaps/__init__.py index 13e667e142..2d0e047233 100644 --- a/django/contrib/sitemaps/__init__.py +++ b/django/contrib/sitemaps/__init__.py @@ -54,9 +54,9 @@ class Sitemap: return obj.get_absolute_url() def _get_paginator(self): - if not hasattr(self, "paginator"): - self.paginator = paginator.Paginator(self.items(), self.limit) - return self.paginator + if not hasattr(self, "_paginator"): + self._paginator = paginator.Paginator(self.items(), self.limit) + return self._paginator paginator = property(_get_paginator) def get_urls(self, page=1):