# HG changeset patch # User dclinton@b35c0ba3-1128-0410-9219-0b39014e361d # Date 1249454063 0 # Branch dclinton # Node ID 1098dd8879363d837af38e44ceba9e51e729627f # Parent 77a955c5c3887f0d88b9349b454d3f06d1c3fa0a Allow unauthenticated calls to GetFriends if username is provided. Fixes bug 88. diff -r 77a955c5c3887f0d88b9349b454d3f06d1c3fa0a -r 1098dd8879363d837af38e44ceba9e51e729627f twitter.py --- a/twitter.py Wed Aug 05 06:33:12 2009 +0000 +++ b/twitter.py Wed Aug 05 06:34:23 2009 +0000 @@ -392,10 +392,10 @@ Returns: A sequence of Status instances, one for each message ''' + if not user and not self._username: + raise TwitterError("User must be specified if API is not authenticated.") if user: url = 'http://twitter.com/statuses/friends_timeline/%s.json' % user - elif not user and not self._username: - raise TwitterError("User must be specified if API is not authenticated.") else: url = 'http://twitter.com/statuses/friends_timeline.json' parameters = {} @@ -656,8 +656,8 @@ Returns: A sequence of twitter.User instances, one for each friend ''' - if not self._username: - raise TwitterError("twitter.Api instance must be authenticated") + if not user and not self._username: + raise TwitterError("User must be specified if API is not authenticated.") if user: url = 'http://twitter.com/statuses/friends/%s.json' % user else: