summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2020-05-13 11:47:43 +0200
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2020-05-16 02:54:37 +0000
commit14a6c0e601b246601954ca18fb44d3cb346e331f (patch)
tree5a42fc8e9a4d77ecf6eb80098f6ffcb7ecb168dd
parentf415a3b53a51b261d08cc3312c25f250d6bc1bd6 (diff)
vppapigen: add assert for python version
The recent introduction of f-strings require >=Python3.6 Fix a couple of pycodestyle warnings. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Id9e375bb8febb157d7f9d7fa21808724770df6f8
-rwxr-xr-xsrc/tools/vppapigen/vppapigen.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py
index 28712e4d949..2d2097904c5 100755
--- a/src/tools/vppapigen/vppapigen.py
+++ b/src/tools/vppapigen/vppapigen.py
@@ -11,6 +11,8 @@ import os
import sys
from subprocess import Popen, PIPE
+assert sys.version_info >= (3, 6), \
+ "Not supported Python version: {}".format(sys.version)
log = logging.getLogger('vppapigen')
# Ensure we don't leave temporary files around
@@ -285,7 +287,7 @@ class Define():
self.options[b.option] = b.value
remove.append(b)
- block = [x for x in block if not x in remove]
+ block = [x for x in block if x not in remove]
self.block = block
self.vla = vla_is_last_check(name, block)
self.crc = str(block).encode()
@@ -765,7 +767,7 @@ class VPPAPI(object):
block = [Field('u32', 'context'),
Field('i32', 'retval')]
# inherhit the parent's options
- for k,v in parent.options.items():
+ for k, v in parent.options.items():
block.append(Option(k, v))
return Define(name + '_reply', [], block)