bots: Fix converter bot.
The converter bot depended on past.utils.old_div, which is not supported anymore. Updating the code to use the // operator, which provides the same functionality.
This commit is contained in:
parent
adb5f645bc
commit
bb70c5beed
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
from past.utils import old_div
|
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import importlib
|
import importlib
|
||||||
|
@ -121,7 +120,7 @@ def get_bot_converter_response(message, client):
|
||||||
number_res /= ut_to_std[1]
|
number_res /= ut_to_std[1]
|
||||||
|
|
||||||
if base_unit == 'bit':
|
if base_unit == 'bit':
|
||||||
number_res *= 1024 ** (old_div(exponent, float(3)))
|
number_res *= 1024 ** (exponent // 3)
|
||||||
else:
|
else:
|
||||||
number_res *= 10 ** exponent
|
number_res *= 10 ** exponent
|
||||||
number_res = round_to(number_res, 7)
|
number_res = round_to(number_res, 7)
|
||||||
|
|
Loading…
Reference in a new issue