summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2020-03-27 13:31:24 -0500
committerJason Madden <jamadden@gmail.com>2020-03-27 13:31:24 -0500
commitbfdb1f04fb41e94990192defd8a6556c76749176 (patch)
treee55327e4a5fb033a1e66b32ba0f6bf640f74cf4b
parentea1937243db5bc24a8fbf4cd2e4b0f940325113f (diff)
downloadzope-tales-bfdb1f04fb41e94990192defd8a6556c76749176.tar.gz
Fix ReST errors in CHANGES.rst and flake8 errors in expressions and test_expressions.py
-rw-r--r--CHANGES.rst2
-rw-r--r--src/zope/tales/expressions.py2
-rw-r--r--src/zope/tales/tests/test_expressions.py2
3 files changed, 4 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index b25d895..3fc7990 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -6,7 +6,9 @@
==================
- Cleanups for Plone 5.2:
+
* in path alternatives, whitespace can now surround ``|``,
+
* non-ASCII in ``SubPathExpr`` now raises a ``CompilerError``
(instead of a ``UnicodeEncodeError``; to be compatible with
the ``chameleon`` template engine).
diff --git a/src/zope/tales/expressions.py b/src/zope/tales/expressions.py
index 13c7097..10584b9 100644
--- a/src/zope/tales/expressions.py
+++ b/src/zope/tales/expressions.py
@@ -68,7 +68,7 @@ class SubPathExpr(object):
compiledpath = []
currentpath = []
try:
- path = str(path)
+ path = str(path)
except Exception as e:
raise engine.getCompilerError()(
'could not convert %r to `str`: %s: %s'
diff --git a/src/zope/tales/tests/test_expressions.py b/src/zope/tales/tests/test_expressions.py
index c6b94b3..9158d7b 100644
--- a/src/zope/tales/tests/test_expressions.py
+++ b/src/zope/tales/tests/test_expressions.py
@@ -173,7 +173,7 @@ class TestParsedExpressions(ExpressionTestBase):
def testNonAsciiPath(self):
error = self.engine.getCompilerError()
with self.assertRaises(error):
- expr = self.engine.compile(u'path: ä')
+ self.engine.compile(u'path: ä')
def test_path_CONTEXTS(self):
self.context.contexts = 42