Skip to content

Commit

Permalink
stats: Check keys instead of bool value of db.
Browse files Browse the repository at this point in the history
  • Loading branch information
chfoo committed Apr 3, 2015
1 parent a20fb78 commit 5ded09d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wpull/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ def is_quota_exceeded(self):
if self._required_urls_db is None:
return False

if self._required_urls_db:
return False
try:
# bool(db) is not guaranteed to be supported, esp on PyPy
if next(iter(self._required_urls_db.keys())):
return False
except StopIteration:
pass

if self.quota:
return self.size >= self.quota
Expand Down

0 comments on commit 5ded09d

Please sign in to comment.