Revision: 7257 Author: nicdumz Date: 2009-09-17 11:22:33 +0000 (Thu, 17 Sep 2009)
Log Message: ----------- Fixing TypeError when throttled on login. sleep expects a float, not a datetime
Modified Paths: -------------- branches/rewrite/pywikibot/data/api.py
Modified: branches/rewrite/pywikibot/data/api.py =================================================================== --- branches/rewrite/pywikibot/data/api.py 2009-09-17 11:22:01 UTC (rev 7256) +++ branches/rewrite/pywikibot/data/api.py 2009-09-17 11:22:33 UTC (rev 7257) @@ -671,7 +671,8 @@ """ if hasattr(self, '_waituntil'): if datetime.now() < self._waituntil: - time.sleep(self._waituntil - datetime.now()) + diff = self._waituntil - datetime.now() + time.sleep(diff.seconds) login_request = Request(site=self.site, action="login", lgname=self.username,