Make pylint happy.
authorTim Newsome <tim@sifive.com>
Mon, 5 Jun 2017 18:46:39 +0000 (11:46 -0700)
committerTim Newsome <tim@sifive.com>
Mon, 5 Jun 2017 18:46:39 +0000 (11:46 -0700)
If we want we can start using print(), but if so let's consistently use
it instead of piecemeal. See also
https://stackoverflow.com/questions/28694380/pylint-says-unnecessary-parens-after-r-keyword

debug/gdbserver.py
debug/targets.py
debug/testlib.py

index 476e51d876c48b46ce43b6ac4cd75d0a7d5bc2a7..4dc00c4dc7eedf1732fd888794fc2afcf5d3463e 100755 (executable)
@@ -11,7 +11,7 @@ import os
 import targets
 import testlib
 from testlib import assertEqual, assertNotEqual, assertIn
-from testlib import assertGreater, assertTrue, assertRegexpMatches, assertLess
+from testlib import assertGreater, assertRegexpMatches, assertLess
 from testlib import GdbTest
 
 MSTATUS_UIE = 0x00000001
index b8557ce5748e3103a515d823ee68895b63f0f483..bd177ecd1a01ec4388c8de593b70af189ea62bde 100644 (file)
@@ -26,7 +26,8 @@ class Target(object):
     def server(self):
         """Start the debug server that gdb connects to, eg. OpenOCD."""
         if self.openocd_config:
-            return testlib.Openocd(server_cmd=self.server_cmd, config=self.openocd_config)
+            return testlib.Openocd(server_cmd=self.server_cmd,
+                    config=self.openocd_config)
         else:
             raise NotImplementedError
 
index 3d08e9b33e172388433950d74f5de40cbb27d2fb..8855e248150c862ec7adff6891bd089013dce8a5 100644 (file)
@@ -21,12 +21,12 @@ def find_file(path):
 def compile(args, xlen=32): # pylint: disable=redefined-builtin
     cc = os.path.expandvars("$RISCV/bin/riscv64-unknown-elf-gcc")
     cmd = [cc, "-g"]
-    if (xlen == 32):
+    if xlen == 32:
         cmd.append("-march=rv32imac")
         cmd.append("-mabi=ilp32")
     else:
         cmd.append("-march=rv64imac")
-        cmd.append("-mabi=lp64")        
+        cmd.append("-mabi=lp64")
     for arg in args:
         found = find_file(arg)
         if found:
@@ -163,9 +163,9 @@ class Openocd(object):
         else:
             openocd = os.path.expandvars("$RISCV/bin/riscv-openocd")
             cmd = [openocd]
-            if (debug):
+            if debug:
                 cmd.append("-d")
-        
+
         # This command needs to come before any config scripts on the command
         # line, since they are executed in order.
         cmd += [
@@ -184,7 +184,7 @@ class Openocd(object):
         if config:
             f = find_file(config)
             if f is None:
-                print("Unable to read file " + config)
+                print "Unable to read file " + config
                 exit(1)
 
             cmd += ["-f", f]
@@ -377,9 +377,10 @@ def run_all_tests(module, target, parsed):
     gdb_cmd = parsed.gdb
 
     todo = []
-    if (parsed.misaval):
+    if parsed.misaval:
         target.misa = int(parsed.misaval, 16)
-        print "Assuming $MISA value of 0x%x. Skipping ExamineTarget." % target.misa
+        print "Assuming $MISA value of 0x%x. Skipping ExamineTarget." % \
+                target.misa
     else:
         todo.append(("ExamineTarget", ExamineTarget))
 
@@ -418,7 +419,8 @@ def add_test_run_options(parser):
     parser.add_argument("--gdb",
             help="The command to use to start gdb.")
     parser.add_argument("--misaval",
-            help="Don't run ExamineTarget, just assume the misa value which is specified.")
+            help="Don't run ExamineTarget, just assume the misa value which is "
+            "specified.")
 
 def header(title, dash='-'):
     if title: