[virt-tools-list] [libvirt] [PATCH 15/22] apibuild: Drop backslash between brackets

Radostin Stoyanov rstoyanov1 at gmail.com
Sat Mar 17 13:48:51 UTC 2018


Backslash between brackets in Python is redundant. [1]

1: https://lintlyci.github.io/Flake8Rules/rules/E502.html

Signed-off-by: Radostin Stoyanov <rstoyanov1 at gmail.com>
---
 docs/apibuild.py | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/docs/apibuild.py b/docs/apibuild.py
index 400be124f..bcf7e5c24 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -385,8 +385,8 @@ class index:
                  # check that function condition agrees with header
                  if idx.functions[id].conditionals != \
                     self.functions[id].conditionals:
-                     self.warning("Header condition differs from Function for %s:" \
-                                      % id)
+                     self.warning("Header condition differs from Function"
+                                  " for %s:" % id)
                      self.warning("  H: %s" % self.functions[id].conditionals)
                      self.warning("  C: %s" % idx.functions[id].conditionals)
                  up = idx.functions[id]
@@ -1883,7 +1883,7 @@ class CParser:
                         raise Exception()
                 except:
                     self.error(("struct '%s' is not allowed to contain long "
-                                "field '%s', use long long instead") \
+                                "field '%s', use long long instead")
                                % (name, field[1]))
 
      #
@@ -1940,8 +1940,8 @@ class CParser:
                 if token[1] == "[":
                     type = type + token[1]
                     token = self.token()
-                    while token is not None and (token[0] != "sep" or \
-                          token[1] != ";"):
+                    while token is not None and (token[0] != "sep" or
+                                                 token[1] != ";"):
                         type = type + token[1]
                         token = self.token()
 
@@ -1955,9 +1955,9 @@ class CParser:
                     token = self.parseBlock(token)
                 else:
                     self.comment = None
-                    while token is not None and (token[0] != "sep" or \
-                          (token[1] != ';' and token[1] != ',')):
-                            token = self.token()
+                    while token is not None and (token[0] != "sep" or
+                                                 token[1] not in ',;'):
+                        token = self.token()
                 self.comment = None
                 if token is None or token[0] != "sep" or (token[1] != ';' and
                    token[1] != ','):
@@ -2352,11 +2352,11 @@ class docBuilder:
             module = self.modulename_file(file)
             output.write("    <file name='%s'>\n" % (module))
             dict = self.headers[file]
-            ids = uniq(list(dict.functions.keys()) + \
-                       list(dict.variables.keys()) + \
-                       list(dict.macros.keys()) + \
-                       list(dict.typedefs.keys()) + \
-                       list(dict.structs.keys()) + \
+            ids = uniq(list(dict.functions.keys()) +
+                       list(dict.variables.keys()) +
+                       list(dict.macros.keys()) +
+                       list(dict.typedefs.keys()) +
+                       list(dict.structs.keys()) +
                        list(dict.enums.keys()))
             for id in ids:
                 output.write("      <ref name='%s'/>\n" % (id))
-- 
2.14.3




More information about the virt-tools-list mailing list