diff options
| author | django-bot <ops@djangoproject.com> | 2025-07-22 20:41:41 -0700 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2025-07-23 20:17:55 -0300 |
| commit | 69a93a88edb56ba47f624dac7a21aacc47ea474f (patch) | |
| tree | f57507a4435d032493cae40e06ecb254790b67b2 /django/template/base.py | |
| parent | 55b0cc21310b76ce4018dd793ba50556eaf0af06 (diff) | |
Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
Diffstat (limited to 'django/template/base.py')
| -rw-r--r-- | django/template/base.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/django/template/base.py b/django/template/base.py index 121a47d638..3e8a59fbe7 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -482,7 +482,8 @@ class Parser: nodelist = NodeList() while self.tokens: token = self.next_token() - # Use the raw values here for TokenType.* for a tiny performance boost. + # Use the raw values here for TokenType.* for a tiny performance + # boost. token_type = token.token_type.value if token_type == 0: # TokenType.TEXT self.extend_nodelist(nodelist, TextNode(token.contents), token) @@ -845,8 +846,8 @@ class Variable: try: self.literal = mark_safe(unescape_string_literal(var)) except ValueError: - # Otherwise we'll set self.lookups so that resolve() knows we're - # dealing with a bonafide variable + # Otherwise we'll set self.lookups so that resolve() knows + # we're dealing with a bonafide variable if VARIABLE_ATTRIBUTE_SEPARATOR + "_" in var or var[0] == "_": raise TemplateSyntaxError( "Variables and attributes may " @@ -907,7 +908,8 @@ class Variable: # numpy < 1.9 and 1.9+ respectively except (TypeError, AttributeError, KeyError, ValueError, IndexError): try: # attribute lookup - # Don't return class attributes if the class is the context: + # Don't return class attributes if the class is the + # context: if isinstance(current, BaseContext) and getattr( type(current), bit ): |
