Browse Source

Fix borken print() function calls in lib/chutney/TorNet.py.

The `%` operator needs to go inside the call to the `print()` function.
Otherwise, the format string operation is being done on the return value of
`print()`, which is `None`.

 * FIXES #18341: https://bugs.torproject.org/18341.
Isis Lovecruft 8 years ago
parent
commit
5a63784d40
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lib/chutney/TorNet.py

+ 4 - 4
lib/chutney/TorNet.py

@@ -252,7 +252,7 @@ class LocalNodeBuilder(NodeBuilder):
                 if e.errno == errno.ENOENT:
                     print ("Cannot find tor binary %r. Use "
                            "CHUTNEY_TOR environment variable to set the "
-                           "path, or put the binary into $PATH.") % tor
+                           "path, or put the binary into $PATH." % tor)
                     sys.exit(0)
                 else:
                     raise
@@ -384,7 +384,7 @@ class LocalNodeBuilder(NodeBuilder):
             if e.errno == errno.ENOENT:
                 print("Cannot find tor-gencert binary %r. Use "
                       "CHUTNEY_TOR_GENCERT environment variable to set the "
-                      "path, or put the binary into $PATH.") % tor_gencert
+                      "path, or put the binary into $PATH." % tor_gencert)
                 sys.exit(0)
             else:
                 raise
@@ -412,7 +412,7 @@ class LocalNodeBuilder(NodeBuilder):
             if e.errno == errno.ENOENT:
                 print("Cannot find tor binary %r. Use "
                       "CHUTNEY_TOR environment variable to set the "
-                      "path, or put the binary into $PATH.") % tor
+                      "path, or put the binary into $PATH." % tor)
                 sys.exit(0)
             else:
                 raise
@@ -579,7 +579,7 @@ class LocalNodeController(NodeController):
             if e.errno == errno.ENOENT:
                 print("Cannot find tor binary %r. Use CHUTNEY_TOR "
                       "environment variable to set the path, or put the "
-                      "binary into $PATH.") % tor_path
+                      "binary into $PATH." % tor_path)
                 sys.exit(0)
             else:
                 raise