diff options
| author | Jason Madden <jamadden@gmail.com> | 2017-06-14 17:23:49 -0500 |
|---|---|---|
| committer | Jason Madden <jamadden@gmail.com> | 2017-06-14 17:23:49 -0500 |
| commit | 06ba12901c21a289670a8d6ae1c2127950d03422 (patch) | |
| tree | c95d95503b4cef3b7b42a49baa84ad2d0cc86689 /src | |
| parent | 3a1a264e6dc116c620153d2b691d5668dfaee9a4 (diff) | |
| download | zope-interface-06ba12901c21a289670a8d6ae1c2127950d03422.tar.gz | |
cleanups requested by @tseaver: remove assert from _implements since all its callers already do this guard; be more explicit about ClassType in test_odd_declarations
Diffstat (limited to 'src')
| -rw-r--r-- | src/zope/interface/declarations.py | 1 | ||||
| -rw-r--r-- | src/zope/interface/tests/test_odd_declarations.py | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/zope/interface/declarations.py b/src/zope/interface/declarations.py index aaf196b..acea120 100644 --- a/src/zope/interface/declarations.py +++ b/src/zope/interface/declarations.py @@ -436,7 +436,6 @@ class implementer_only: def _implements(name, interfaces, classImplements): # This entire approach is invalid under Py3K. Don't even try to fix # the coverage for this block there. :( - assert not PYTHON3, "Class advice impossible in Python 3" frame = sys._getframe(2) locals = frame.f_locals diff --git a/src/zope/interface/tests/test_odd_declarations.py b/src/zope/interface/tests/test_odd_declarations.py index 01fa6c6..46e7675 100644 --- a/src/zope/interface/tests/test_odd_declarations.py +++ b/src/zope/interface/tests/test_odd_declarations.py @@ -257,9 +257,12 @@ class Test(unittest.TestCase): self.assertEqual(c.c, 1) c.c - import sys - if sys.version_info[0] < 3: # This test only makes sense under Python 2.x + try: from types import ClassType + except ImportError: + pass + else: + # This test only makes sense under Python 2.x assert not isinstance(C, (type, ClassType)) self.assertIs(C.__class__.__class__, C.__class__) |
