From 50b08d94d9b76f06363a4c3d567bccfb51318add Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Sat, 11 Feb 2012 22:54:46 +0100 Subject: [PATCH] Make a few __get__ methods work properly on their class Automatic doc generation requires this. --- pokedex/db/markdown.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pokedex/db/markdown.py b/pokedex/db/markdown.py index 0eafaf6..1089900 100644 --- a/pokedex/db/markdown.py +++ b/pokedex/db/markdown.py @@ -121,6 +121,8 @@ class MoveEffectProperty(object): self.effect_column = effect_column def __get__(self, obj, cls): + if obj is None: + return self if obj.move_effect is None: return None prop = getattr(obj.move_effect, self.effect_column) @@ -131,6 +133,8 @@ class MoveEffectPropertyMap(MoveEffectProperty): proxies. """ def __get__(self, obj, cls): + if obj is None: + return self prop = getattr(obj.move_effect, self.effect_column) newdict = dict(prop) for key in newdict: