changeset 2494:c4d418b440d1 beta

small fix for lazy property
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 20 Jun 2012 21:10:40 +0200
parents a93db48c75f5
children 9766f0baf5c5
files rhodecode/lib/vcs/utils/lazy.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/vcs/utils/lazy.py	Wed Jun 20 11:57:44 2012 +0000
+++ b/rhodecode/lib/vcs/utils/lazy.py	Wed Jun 20 21:10:40 2012 +0200
@@ -17,11 +17,12 @@
 
     def __init__(self, func):
         self._func = func
+        self.__module__ = func.__module__
         self.__name__ = func.__name__
         self.__doc__ = func.__doc__
 
     def __get__(self, obj, klass=None):
         if obj is None:
-            return None
+            return self
         result = obj.__dict__[self.__name__] = self._func(obj)
         return result