summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Madden <jason+github@nextthought.com>2018-10-16 10:44:13 -0500
committerGitHub <noreply@github.com>2018-10-16 10:44:13 -0500
commitb1d4c826f3cee6e66c0b56489db4dd7046ec1fca (patch)
tree0a6909a028908809bba0bba313ff6f4f7a9dfbd4
parent1224e11849a541f4ca0c029e2b283a7c3e9fb14b (diff)
parentad35e6123e54335c916053b2c8b588e030cd072c (diff)
downloadzope-pagetemplate-b1d4c826f3cee6e66c0b56489db4dd7046ec1fca.tar.gz
Merge pull request #18 from zopefoundation/issue17
Fix deprecation warnings.
-rw-r--r--CHANGES.rst9
-rw-r--r--setup.py2
-rw-r--r--src/zope/pagetemplate/engine.py2
-rw-r--r--src/zope/pagetemplate/tests/test_engine.py11
4 files changed, 14 insertions, 10 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index a709792..0165f79 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -2,11 +2,12 @@
Changes
=========
-4.5 (unreleased)
-================
-
-- Nothing changed yet.
+4.5.0 (unreleased)
+==================
+- Fix DeprecationWarnings for ``ComponentLookupError`` by
+ importing them from ``zope.interface.interfaces``. See `issue 17
+ <https://github.com/zopefoundation/zope.pagetemplate/issues/17>`_.
4.4 (2018-10-05)
================
diff --git a/setup.py b/setup.py
index c906cce..11f5f50 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ TESTS_REQUIRE = [
setup(name='zope.pagetemplate',
- version='4.5.dev0',
+ version='4.5.0.dev0',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
description='Zope Page Templates',
diff --git a/src/zope/pagetemplate/engine.py b/src/zope/pagetemplate/engine.py
index 5fd6679..138109b 100644
--- a/src/zope/pagetemplate/engine.py
+++ b/src/zope/pagetemplate/engine.py
@@ -21,7 +21,7 @@ import sys
from zope import component
from zope.interface import implementer
-from zope.component.interfaces import ComponentLookupError
+from zope.interface.interfaces import ComponentLookupError
from zope.proxy import isProxy
from zope.traversing.interfaces import IPathAdapter, ITraversable
from zope.traversing.interfaces import TraversalError
diff --git a/src/zope/pagetemplate/tests/test_engine.py b/src/zope/pagetemplate/tests/test_engine.py
index ab61408..97ec8f6 100644
--- a/src/zope/pagetemplate/tests/test_engine.py
+++ b/src/zope/pagetemplate/tests/test_engine.py
@@ -86,6 +86,9 @@ class ZopePythonExprTests(unittest.TestCase):
class TestZopeContext(PlacelessSetup,
unittest.TestCase):
+ assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex',
+ getattr(unittest.TestCase, 'assertRaisesRegexp'))
+
def _makeOne(self):
return zope.pagetemplate.engine.ZopeContext(None, {})
@@ -95,8 +98,8 @@ class TestZopeContext(PlacelessSetup,
def test_evaluate_error(self):
ctx = self._makeOne()
- with self.assertRaisesRegexp(zope.pagetemplate.engine.InlineCodeError,
- "Inline Code Evaluation is deactivated"):
+ with self.assertRaisesRegex(zope.pagetemplate.engine.InlineCodeError,
+ "Inline Code Evaluation is deactivated"):
ctx.evaluateCode('lang', 'code')
def test_evaluate_interpreter_not_importable(self):
@@ -117,8 +120,8 @@ class TestZopeContext(PlacelessSetup,
ctx.evaluateInlineCode = True
zope.pagetemplate.engine._get_iinterpreter = mock_get
try:
- with self.assertRaisesRegexp(zope.pagetemplate.engine.InlineCodeError,
- "No interpreter named"):
+ with self.assertRaisesRegex(zope.pagetemplate.engine.InlineCodeError,
+ "No interpreter named"):
ctx.evaluateCode('lang', 'code')
finally:
zope.pagetemplate.engine._get_iinterpreter = get