Wrapper for tweepy.api.update_status with a 10s wait when twitter is over capacity

def update_status(self, *pargs, **kwargs):
        """
        Wrapper for tweepy.api.update_status with a 10s wait when twitter is over capacity
        """
        try:
            return super(API, self).update_status(*pargs, **kwargs)

        except tweepy.TweepError as e:
            if getattr(e, 'api_code', None) == 503:
                sleep(10)
                return super(API, self).update_status(*pargs, **kwargs)
            else:
                raise e