]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Fixed some string literal warnings. Fixes #646
authorArmin Ronacher <armin.ronacher@active-4.com>
Sun, 8 Jan 2017 22:40:38 +0000 (23:40 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sun, 8 Jan 2017 22:40:38 +0000 (23:40 +0100)
CHANGES
jinja2/lexer.py
jinja2/nodes.py
jinja2/runtime.py

diff --git a/CHANGES b/CHANGES
index 8e5b4ab37cf5d5f382df054314eb39cae8dfecbd..4d8fabb17b72246c79648626ba158c73bab49c82 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
 Jinja2 Changelog
 ================
 
+Version 2.9.4
+-------------
+(unreleased bugfix release)
+
+- Solved some warnings for string literals.  (#646)
+
 Version 2.9.3
 -------------
 (bugfix release, released on January 8th 2017)
index ca2914ac384dbe1ac75eec8a9f9b24cf9315d939..b646cb91768d21407c2010220c56985218121f4e 100644 (file)
@@ -288,7 +288,7 @@ class TokenStreamIterator(object):
 
 @implements_iterator
 class TokenStream(object):
-    """A token stream is an iterable that yields :class:`Token`\s.  The
+    """A token stream is an iterable that yields :class:`Token`\\s.  The
     parser however does not iterate over it but calls :meth:`next` to go
     one token ahead.  The current active token is stored as :attr:`current`.
     """
@@ -500,7 +500,7 @@ class Lexer(object):
             ],
             # blocks
             TOKEN_BLOCK_BEGIN: [
-                (c('(?:\-%s\s*|%s)%s' % (
+                (c(r'(?:\-%s\s*|%s)%s' % (
                     e(environment.block_end_string),
                     e(environment.block_end_string),
                     block_suffix_re
@@ -508,14 +508,14 @@ class Lexer(object):
             ] + tag_rules,
             # variables
             TOKEN_VARIABLE_BEGIN: [
-                (c('\-%s\s*|%s' % (
+                (c(r'\-%s\s*|%s' % (
                     e(environment.variable_end_string),
                     e(environment.variable_end_string)
                 )), TOKEN_VARIABLE_END, '#pop')
             ] + tag_rules,
             # raw block
             TOKEN_RAW_BEGIN: [
-                (c('(.*?)((?:\s*%s\-|%s)\s*endraw\s*(?:\-%s\s*|%s%s))' % (
+                (c(r'(.*?)((?:\s*%s\-|%s)\s*endraw\s*(?:\-%s\s*|%s%s))' % (
                     e(environment.block_start_string),
                     block_prefix_re,
                     e(environment.block_end_string),
index 2c6a296a5887b29de82347db911ae528e01f24d4..aa4df72380aae59c04df28bfa907a2a2bf7c482e 100644 (file)
@@ -721,7 +721,7 @@ class Concat(Expr):
 
 class Compare(Expr):
     """Compares an expression with some other expressions.  `ops` must be a
-    list of :class:`Operand`\s.
+    list of :class:`Operand`\\s.
     """
     fields = ('expr', 'ops')
 
index 5c2089b8c0a6206a8ed0465cd418e3008b32c748..03e303f14401e470971d2891ba06133a3ca96314 100644 (file)
@@ -100,7 +100,7 @@ class Context(object):
     The context is immutable.  Modifications on :attr:`parent` **must not**
     happen and modifications on :attr:`vars` are allowed from generated
     template code only.  Template filters and global functions marked as
-    :func:`contextfunction`\s get the active context passed as first argument
+    :func:`contextfunction`\\s get the active context passed as first argument
     and are allowed to access the context read-only.
 
     The template context supports read only dict operations (`get`,