~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ssh.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Robey Pointer <robey@lag.net>
 
1
# Copyright (C) 2005 Robey Pointer <robey@lag.net>
2
2
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
173
173
register_ssh_vendor = _ssh_vendor_manager.register_vendor
174
174
 
175
175
 
176
 
def _ignore_signals():
 
176
def _ignore_sigint():
177
177
    # TODO: This should possibly ignore SIGHUP as well, but bzr currently
178
178
    # doesn't handle it itself.
179
179
    # <https://launchpad.net/products/bzr/+bug/41433/+index>
180
180
    import signal
181
181
    signal.signal(signal.SIGINT, signal.SIG_IGN)
182
 
    # GZ 2010-02-19: Perhaps make this check if breakin is installed instead
183
 
    if signal.getsignal(signal.SIGQUIT) != signal.SIG_DFL:
184
 
        signal.signal(signal.SIGQUIT, signal.SIG_IGN)
185
182
 
186
183
 
187
184
class SocketAsChannelAdapter(object):
637
634
        # Running it in a separate process group is not good because then it
638
635
        # can't get non-echoed input of a password or passphrase.
639
636
        # <https://launchpad.net/products/bzr/+bug/40508>
640
 
        return {'preexec_fn': _ignore_signals,
 
637
        return {'preexec_fn': _ignore_sigint,
641
638
                'close_fds': True,
642
639
                }
643
640