[Spice-commits] python_modules/ptypes.py

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 12 16:01:44 UTC 2019

 python_modules/ptypes.py |    2 --
 1 file changed, 2 deletions(-)

New commits:
commit a52a0a09066b4e94ec5b469bc5d4f85be57bc6c6
Author: Uri Lublin <uril at redhat.com>
Date:   Sun Aug 11 12:26:04 2019 +0300

    ptypes.py: remove useless condition member != None
    member = None is set before the if/else condition.
    In the else code, when member is set it is checked
    and if not-None it breaks out of the loop.
    If the code is still in the loop for sure member is None.
    Found by covscan.
    Signed-off-by: Uri Lublin <uril at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index b08170e..311ce3d 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -884,8 +884,6 @@ class ContainerType(Type):
                     member = m.lookup_case_member(name)
                     if member != None:
-                if member != None:
-                    break
         if member == None:
             raise Exception("No member called %s found" % name)

More information about the Spice-commits mailing list