mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-11-18 12:23:48 +03:00
Cleanup for a return statement in source files
Return statements with parameter enclosed in parentheses were modified and parentheses were removed. The whole change was scripted, here is how: List of files was obtained using this command: git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \ grep -e '\.[ch]$' -e '\.py$' Found files were modified with this command: sed -i -e \ 's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \ -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_' Then checked for nonsense. The whole command looks like this: git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \ grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e \ 's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \ -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
This commit is contained in:
committed by
Eric Blake
parent
dc2f75d35a
commit
a8e031a749
@@ -66,7 +66,7 @@ libvirt_qemu_virDomainQemuMonitorCommand(PyObject *self ATTRIBUTE_UNUSED,
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)"Ozi:virDomainQemuMonitorCommand",
|
||||
&pyobj_domain, &cmd, &flags))
|
||||
return(NULL);
|
||||
return NULL;
|
||||
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
||||
|
||||
if (domain == NULL)
|
||||
@@ -79,7 +79,7 @@ libvirt_qemu_virDomainQemuMonitorCommand(PyObject *self ATTRIBUTE_UNUSED,
|
||||
return VIR_PY_NONE;
|
||||
|
||||
py_retval = PyString_FromString(result);
|
||||
return(py_retval);
|
||||
return py_retval;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user