[libvirt] [PATCH] scripts: fix list indexing when printing mis-ordered symbols

Daniel P. Berrangé posted 1 patch 4 years, 4 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20191203171502.87780-1-berrange@redhat.com
scripts/check-symsorting.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[libvirt] [PATCH] scripts: fix list indexing when printing mis-ordered symbols
Posted by Daniel P. Berrangé 4 years, 4 months ago
The python array slice syntax expects the first and last indexes,
not the first length and element count.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 scripts/check-symsorting.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/check-symsorting.py b/scripts/check-symsorting.py
index 8e698c0657..006c42f1b3 100755
--- a/scripts/check-symsorting.py
+++ b/scripts/check-symsorting.py
@@ -59,8 +59,8 @@ def check_sorting(group, symfile, line, groupfile, lastgroup):
             issorted = False
 
     if not issorted:
-        actual = group[first:(last - first + 1)]
-        expect = sortedgroup[first:(last - first + 1)]
+        actual = group[first:last]
+        expect = sortedgroup[first:last]
         print("Symbol block at %s:%s: symbols not sorted" %
               (symfile, line), file=sys.stderr)
         for g in actual:
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] scripts: fix list indexing when printing mis-ordered symbols
Posted by Michal Privoznik 4 years, 4 months ago
On 12/3/19 6:15 PM, Daniel P. Berrangé wrote:
> The python array slice syntax expects the first and last indexes,
> not the first length and element count.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   scripts/check-symsorting.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list