diff options
author | Jason Madden <jamadden@gmail.com> | 2020-03-27 13:31:24 -0500 |
---|---|---|
committer | Jason Madden <jamadden@gmail.com> | 2020-03-27 13:31:24 -0500 |
commit | bfdb1f04fb41e94990192defd8a6556c76749176 (patch) | |
tree | e55327e4a5fb033a1e66b32ba0f6bf640f74cf4b | |
parent | ea1937243db5bc24a8fbf4cd2e4b0f940325113f (diff) | |
download | zope-tales-bfdb1f04fb41e94990192defd8a6556c76749176.tar.gz |
Fix ReST errors in CHANGES.rst and flake8 errors in expressions and test_expressions.py
-rw-r--r-- | CHANGES.rst | 2 | ||||
-rw-r--r-- | src/zope/tales/expressions.py | 2 | ||||
-rw-r--r-- | src/zope/tales/tests/test_expressions.py | 2 |
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 |