1. pydica
  2. pydica
  3. tiffany

Commits

Christian Tismer  committed e065daf

python 2.6 compatibility which is just ugly to get. This is the shortest version I can do.
Because that is really not the topic of this module, I don't elaborate on the why ad how,
but simply put the missing stuff in.

  • Participants
  • Parent commits fcc47c1
  • Branches default

Comments (0)

Files changed (1)

File tiffany/monkeypil.py

View file
  • Ignore whitespace
     return f
 
 
+# compatibility helper for Python 2.6
+if sys.version_info[:2] < (2, 7):
+    class classmethod(classmethod):
+        __func__ = property(lambda self: self.im_func)
+    class staticmethod(staticmethod):
+        __func__ = property(lambda self: self.__get__(0))
+
+
 # a handy metaclass that injects a class into a different module
 class TiffanyMeta(type):
     def __new__(_mcs, _name, _bases, _dict):