Use 'future' division in src/ircutils.py.

This commit is contained in:
Valentin Lorentz 2012-08-04 14:18:53 +02:00
parent df2d976818
commit 66e4243a14

View File

@ -35,6 +35,8 @@ dicts, a nick class to handle nicks (so comparisons and hashing and whatnot
work in an IRC-case-insensitive fashion), and numerous other things. work in an IRC-case-insensitive fashion), and numerous other things.
""" """
from __future__ import division
import re import re
import time import time
import random import random
@ -483,7 +485,7 @@ def dccIP(ip):
x = 256**3 x = 256**3
for quad in ip.split('.'): for quad in ip.split('.'):
i += int(quad)*x i += int(quad)*x
x /= 256 x //= 256
return i return i
def unDccIP(i): def unDccIP(i):
@ -492,7 +494,7 @@ def unDccIP(i):
L = [] L = []
while len(L) < 4: while len(L) < 4:
L.append(i % 256) L.append(i % 256)
i /= 256 i //= 256
L.reverse() L.reverse()
return '.'.join(imap(str, L)) return '.'.join(imap(str, L))