use floor division instead of math.floor

This commit is contained in:
Eli Schwartz 2019-07-18 12:22:26 -04:00
parent 4b280adcc9
commit 8b75e8c3e3
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -9,7 +9,7 @@ forced at "likely" locations to conform to size limitations. This transform
assumes a prior call to the flatcss transform. assumes a prior call to the flatcss transform.
''' '''
import os, math, functools, collections, re, copy import os, functools, collections, re, copy
from collections import OrderedDict from collections import OrderedDict
from lxml.etree import XPath as _XPath from lxml.etree import XPath as _XPath
@ -390,7 +390,7 @@ class FlowSplitter(object):
elems = [i for i in elems if i.get(SPLIT_POINT_ATTR, '0') != elems = [i for i in elems if i.get(SPLIT_POINT_ATTR, '0') !=
'1'] '1']
if elems: if elems:
i = int(math.floor(len(elems)/2.)) i = int(len(elems)//2)
elems[i].set(SPLIT_POINT_ATTR, '1') elems[i].set(SPLIT_POINT_ATTR, '1')
return elems[i] return elems[i]