Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ikasamah committed Feb 14, 2011
1 parent 4a2f092 commit 0d2bc35
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions withings.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ def __init__(self, id, publickey):

def __getattr__(self, name):
if name in self.__dict__['_valid_attrs']:
if name not in self.__dict__:
self.getbyuserid()
if name in self.__dict__:
return self.__dict__[name]
raise AttributeError
self.getbyuserid()
try:
return self.__dict__[name]
except KeyError:
pass
raise AttributeError(name)

def __str__(self):
return '%s: %s' % (self.id, self.fullname())
Expand Down

0 comments on commit 0d2bc35

Please sign in to comment.