diff options
| author | Michael Merickel <michael@merickel.org> | 2012-04-10 23:41:12 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2012-04-10 23:41:12 -0500 |
| commit | 6d2187e8706618861c3a5cc9e66c8f11bfc62364 (patch) | |
| tree | cc699e89b6c6c0af022e770862bb06def4e7b424 | |
| parent | 3f310683151e4d6285e9bfa3f74883a6521e62b3 (diff) | |
| download | pyramid-6d2187e8706618861c3a5cc9e66c8f11bfc62364.tar.gz pyramid-6d2187e8706618861c3a5cc9e66c8f11bfc62364.tar.bz2 pyramid-6d2187e8706618861c3a5cc9e66c8f11bfc62364.zip | |
changed to classmethod
| -rw-r--r-- | pyramid/tests/test_util.py | 4 | ||||
| -rw-r--r-- | 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. |
