Use ret and exit with it directly.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
scripts/group-qemu-caps.py | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py
index bcda29a6ca..356d9e8d06 100755
--- a/scripts/group-qemu-caps.py
+++ b/scripts/group-qemu-caps.py
@@ -128,8 +128,6 @@ parser.add_argument('--prefix', default='',
help='source code tree prefix')
args = parser.parse_args()
-errs = False
-
header_path = args.prefix + 'src/qemu/qemu_capabilities.h'
source_path = args.prefix + 'src/qemu/qemu_capabilities.c'
@@ -151,18 +149,18 @@ source_fixed = regroup_caps(source_lines[source_start +
1:source_end],
" ",
capsflags=capsflags)
+ret = 0
+
if not check_wrapping(header_path,
header_lines,
header_lines[:start + 1] + header_fixed + header_lines[end:],
args.check):
- ret = False
+ ret = 1
if not check_wrapping(source_path,
source_lines,
source_lines[:source_start + 1] + source_fixed +
source_lines[source_end:],
args.check):
- ret = False
+ ret = 1
-if errs:
- sys.exit(1)
-sys.exit(0)
+sys.exit(ret)
--
2.31.1