Replace else-if with elif.

This commit is contained in:
Ethan Dalool 2020-02-17 23:04:39 -08:00
parent 1d0f96a966
commit 9b8b0b6339

View file

@ -52,9 +52,10 @@ class Ratelimiter:
if self.balance >= cost: if self.balance >= cost:
self.balance -= cost self.balance -= cost
successful = True successful = True
else:
if self.mode == 'reject': elif self.mode == 'reject':
successful = False successful = False
else: else:
deficit = cost - self.balance deficit = cost - self.balance
time_needed = deficit / self.gain_rate time_needed = deficit / self.gain_rate