diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2017-06-29 20:33:23 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-07-06 14:06:08 -0700 |
commit | 3fa5aa4294377e0f35267936d0c5caea3e61db48 (patch) | |
tree | 5c501871420a304c7244b8c48163b92f5a7b2716 | |
parent | fa145f1a53943243f94a32ce98525db8494b0052 (diff) | |
download | openvswitch-3fa5aa4294377e0f35267936d0c5caea3e61db48.tar.gz |
Python3 compatibility: math error compatibility
The way math is handled with typing is completely different in python3.
% python2<<EOF
x=10
y=8
print((x + (y - 1)) / y * y)
EOF
16
python3<<EOF
x=10
y=8
print((x + (y - 1)) / y * y)
EOF
17.0
So we need to force an integer for the round function as follows and
maintain compatibility with python2.
python3<<EOF
x=10
y=8
print(int((x + (y - 1)) / y) * y)
EOF
16
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
-rwxr-xr-x | build-aux/extract-ofp-actions | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions index c11297c60..bd7131f1a 100755 --- a/build-aux/extract-ofp-actions +++ b/build-aux/extract-ofp-actions @@ -35,7 +35,7 @@ line = "" arg_structs = set() def round_up(x, y): - return (x + (y - 1)) / y * y + return int((x + (y - 1)) / y) * y def open_file(fn): global file_name |