[python PATCH] maint: balance {} usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emacs gets lost when finding function boundaries when #ifdef
sections do not have balanced {}.

* libvirt-override.c (virPyDictToTypedParams): Avoid unbalanced {}
across ifdef.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---

This feels trivial, but it's also hacky enough that I'll wait
for a review.

 libvirt-override.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libvirt-override.c b/libvirt-override.c
index aecf25d..3a21bcc 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -321,10 +321,12 @@ virPyDictToTypedParams(PyObject *dict,
         }

         if (type == -1) {
+            if (false) {
+                /* hack to keep balanced {} */
 #if PY_MAJOR_VERSION > 2
-            if (PyUnicode_Check(value)) {
+            } else if (PyUnicode_Check(value)) {
 #else
-            if (PyString_Check(value)) {
+            } else if (PyString_Check(value)) {
 #endif
                 type = VIR_TYPED_PARAM_STRING;
             } else if (PyBool_Check(value)) {
-- 
1.8.5.3

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]