Skip to content

Commit

Permalink
fix: handle large numbers ("1.7k issues")
Browse files Browse the repository at this point in the history
  • Loading branch information
user2589 committed Mar 31, 2019
1 parent c729f90 commit 5e84046
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stgithub.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def normalize_text(string):
def _int(value):
if isinstance(value, six.string_types):
value = value.replace(",", "")
if value.endswith('k'):
# in the detailed list, large numbers are reduced
# to something like "1.7k"
value = float(value[:-1]) * 1000
return int(value)


Expand Down Expand Up @@ -374,6 +378,7 @@ def _request(self, url, params=None, headers=None):
self.queue.put(time.time())

# handle network errors and GitHub downtimes
# also, internal errors, like joshaber March 2015
r = None
for _ in range(self.retries_on_timeout):
try:
Expand Down

0 comments on commit 5e84046

Please sign in to comment.