aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-02-28 08:46:05 -0500
committerNick Mathewson <nickm@torproject.org>2014-02-28 08:46:05 -0500
commit8d1007189f7024d796687e94dc461864288af8df (patch)
tree3d9b884581a1645a6870c5e38c0a5b5e6d1cbb91 /lib
parent32d498be07ae9858d3f618fb52a7d32f9f0391d4 (diff)
downloadchutney-master.tar
chutney-master.tar.gz
Clean up ENOENT messages a bitHEADmaster
Diffstat (limited to 'lib')
-rw-r--r--lib/chutney/TorNet.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index ec467a3..3685ec0 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -281,10 +281,10 @@ class LocalNodeBuilder(NodeBuilder):
p = subprocess.Popen(cmdline, stdin=subprocess.PIPE)
except OSError as e:
# only catch file not found error
- if errno.errorcode[e.errno] == 'ENOENT':
- print ''.join(["Cannot find tor-gencert binary, use ",
- "CHUTNEY_TOR_GENCERT environment variable to set the ",
- "path or put the binary into $PATH."])
+ 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
sys.exit(0)
else:
raise
@@ -310,10 +310,10 @@ class LocalNodeBuilder(NodeBuilder):
p = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
except OSError as e:
# only catch file not found error
- if errno.errorcode[e.errno] == 'ENOENT':
- print ''.join(["Cannot find tor-gencert binary, use ",
- "CHUTNEY_TOR_GENCERT environment variable to set the ",
- "path or put the binary into $PATH."])
+ 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
sys.exit(0)
else:
raise
@@ -473,10 +473,10 @@ class LocalNodeController(NodeController):
p = subprocess.Popen(cmdline)
except OSError as e:
# only catch file not found error
- if errno.errorcode[e.errno] == 'ENOENT':
- print ''.join(["Cannot find Tor binary, use CHUTNEY_TOR ",
- "environment variable to set the path or put the binary ",
- "into $PATH."])
+ 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
sys.exit(0)
else:
raise