diff options
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.patch | 51 |
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 @@ | |||
| 1 | From bc29f98f0137fa1083a4cacf832d52f740d150a8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jason Wessel <jason.wessel@windriver.com> | ||
| 3 | Date: Thu, 29 Jun 2017 20:33:23 -0700 | ||
| 4 | Subject: [PATCH 5/8] Python3 compatibility: fix integer problems | ||
| 5 | |||
| 6 | Commit fa145f1a53943243f94a32ce98525db8494b0052 from | ||
| 7 | https://github.com/openvswitch/ovs.git | ||
| 8 | |||
| 9 | In python3 maxint is not defined, but maxsize is defined in both | ||
| 10 | python2 and python3. | ||
| 11 | |||
| 12 | The put_text() will not automatically use a value which came in as | ||
| 13 | float due to a pior math function and python3 will throw an exception. | ||
| 14 | The simple answer is to convert it with int() and move on. | ||
| 15 | |||
| 16 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
| 17 | Signed-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 | |||
| 23 | diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in | ||
| 24 | index 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: | ||
| 36 | diff --git a/python/build/nroff.py b/python/build/nroff.py | ||
| 37 | index 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 | -- | ||
| 50 | 2.5.0 | ||
| 51 | |||
