f5c5b73 python: Streamline initexception

Authored and Committed by nsoffer 4 years ago
    python: Streamline initexception
    
    When we create the sanlock exception we create a function, create a
    method from the function, create a dict from the method, and finally
    create an exception from the dict. This simple flow does not require
    goto for cleanup.
    
    Creating a dict is simpler and less error prone using Py_BuildValue().
    
    When we finish with unused pointers, it is safer to set them to NULL
    using Py_CLEAR(), ensuring that we don't access freed memory.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    
        
file modified
+12 -19