Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor fix

  • Loading branch information...
commit 248d2634176264379be9cdd068015d06072a27dc 1 parent 01eb1cb
@volpino volpino authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 countries_stats.py
View
6 countries_stats.py
@@ -82,7 +82,7 @@ def process_ip(self, elem):
return
try:
self._country = self.gi.country_name_by_addr(elem.text)
- except (pygeoip.GeoIPError, IndexError, KeyError):
+ except Exception:
logging.warn("Skipping IP %s", elem.text)
else:
if self._country:
@@ -114,9 +114,7 @@ def process_revision(self, _):
end = datetime.date.today()
for dt in rrule(MONTHLY, dtstart=start, until=end):
dt = dt.strftime("%Y/%m")
- if dt in self.data:
- break
- else:
+ if dt not in self.data:
self.data[dt] = Counter()
self.data[current_date][self._country] += 1
Please sign in to comment.
Something went wrong with that request. Please try again.