From 6d2187e8706618861c3a5cc9e66c8f11bfc62364 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Tue, 10 Apr 2012 23:41:12 -0500 Subject: changed to classmethod --- pyramid/tests/test_util.py | 4 ++-- pyramid/util.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyramid/tests/test_util.py b/pyramid/tests/test_util.py index e0998d81d..2a69190f7 100644 --- a/pyramid/tests/test_util.py +++ b/pyramid/tests/test_util.py @@ -111,8 +111,8 @@ class Test_InstancePropertyMixin(unittest.TestCase): def test__make_property(self): from pyramid.decorator import reify - foo = self._makeOne() - name, fn = foo._make_property(lambda x: 1, name='x', reify=True) + cls = self._getTargetClass() + name, fn = cls._make_property(lambda x: 1, name='x', reify=True) self.assertEqual(name, 'x') self.assertTrue(isinstance(fn, reify)) diff --git a/pyramid/util.py b/pyramid/util.py index ff6ac8f4a..7d5c97814 100644 --- a/pyramid/util.py +++ b/pyramid/util.py @@ -20,7 +20,8 @@ class InstancePropertyMixin(object): on the class itself. """ - def _make_property(self, callable, name=None, reify=False): + @classmethod + def _make_property(cls, callable, name=None, reify=False): """ Convert a callable into one suitable for adding to the instance. This will return a 2-tuple containing the computed (name, property) pair. -- cgit v1.2.3