summaryrefslogtreecommitdiffstats
path: root/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch')
-rw-r--r--recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch b/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch
new file mode 100644
index 00000000..717a97db
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch
@@ -0,0 +1,51 @@
1From bc29f98f0137fa1083a4cacf832d52f740d150a8 Mon Sep 17 00:00:00 2001
2From: Jason Wessel <jason.wessel@windriver.com>
3Date: Thu, 29 Jun 2017 20:33:23 -0700
4Subject: [PATCH 5/8] Python3 compatibility: fix integer problems
5
6Commit fa145f1a53943243f94a32ce98525db8494b0052 from
7https://github.com/openvswitch/ovs.git
8
9In python3 maxint is not defined, but maxsize is defined in both
10python2 and python3.
11
12The put_text() will not automatically use a value which came in as
13float due to a pior math function and python3 will throw an exception.
14The simple answer is to convert it with int() and move on.
15
16Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
17Signed-off-by: Ben Pfaff <blp@ovn.org>
18---
19 ovsdb/ovsdb-idlc.in | 2 +-
20 python/build/nroff.py | 2 ++
21 2 files changed, 3 insertions(+), 1 deletion(-)
22
23diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
24index 615548f..7cbcbf5 100755
25--- a/ovsdb/ovsdb-idlc.in
26+++ b/ovsdb/ovsdb-idlc.in
27@@ -358,7 +358,7 @@ static void
28 print(" %s" % type.value.initCDefault(valueVar, type.n_min == 0))
29 print(" }")
30 else:
31- if type.n_max != sys.maxint:
32+ if type.n_max != sys.maxsize:
33 print(" size_t n = MIN(%d, datum->n);" % type.n_max)
34 nMax = "n"
35 else:
36diff --git a/python/build/nroff.py b/python/build/nroff.py
37index c23837f..401f699 100644
38--- a/python/build/nroff.py
39+++ b/python/build/nroff.py
40@@ -148,6 +148,8 @@ def fatal(msg):
41
42
43 def put_text(text, x, y, s):
44+ x = int(x)
45+ y = int(y)
46 extend = x + len(s) - len(text[y])
47 if extend > 0:
48 text[y] += ' ' * extend
49--
502.5.0
51