summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyramid/tests/test_config/test_util.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/pyramid/tests/test_config/test_util.py b/pyramid/tests/test_config/test_util.py
index c9b0e9e9b..0d0de9579 100644
--- a/pyramid/tests/test_config/test_util.py
+++ b/pyramid/tests/test_config/test_util.py
@@ -568,13 +568,12 @@ class Test_takes_one_arg(unittest.TestCase):
foo = Foo()
self.assertTrue(self._callFUT(foo.method))
- if PY3:
- def test_function_annotations(self):
- def foo(bar):
- """ """
- # avoid SyntaxErrors in python2
- foo.__annotations__.update({'bar': 'baz'})
- self.assertTrue(self._callFUT(foo))
+ def test_function_annotations(self):
+ def foo(bar):
+ """ """
+ # avoid SyntaxErrors in python2, this if effectively nop
+ getattr(foo, '__annotations__', {}).update({'bar': 'baz'})
+ self.assertTrue(self._callFUT(foo))
class TestNotted(unittest.TestCase):
def _makeOne(self, predicate):