Don't bother with a backtrace when we produce certain fatal errors.

We'll introduce a new "Fatal" exception for this purpose, and throw it when
we just want to print a user message and abort immediately.
This commit is contained in:
Avery Pennarun
2010-05-02 02:23:42 -04:00
parent 2dd328ada4
commit 81c89ce9be
5 changed files with 54 additions and 36 deletions

5
ssh.py
View File

@ -19,10 +19,9 @@ def connect(rhost):
# stuff here.
escapedir = re.sub(r'([^\w/])', r'\\\\\\\1', nicedir)
cmd = r"""
sh -c PATH=%s:'$PATH exec sshuttle --server'
""" % (escapedir,)
sh -c PATH=%s:'$PATH exec sshuttle --server%s'
""" % (escapedir, ' -v' * (helpers.verbose or 0))
argv = ['ssh', rhost, '--', cmd.strip()]
print repr(argv)
(s1,s2) = socket.socketpair()
def setup():
# runs in the child process