Skip to content

Commit

Permalink
patch from Shad Sharma to raise an exception if the transport isn't a…
Browse files Browse the repository at this point in the history
…ctive when you try to open a new channel.
  • Loading branch information
Robey Pointer committed Apr 25, 2010
1 parent 188c82e commit 81c7edc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions paramiko/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,8 @@ def open_channel(self, kind, dest_addr=None, src_addr=None):
@raise SSHException: if the request is rejected or the session ends
prematurely
"""
chan = None
if not self.active:
# don't bother trying to allocate a channel
return None
raise SSHException('SSH session not active')
self.lock.acquire()
try:
chanid = self._next_channel()
Expand Down

0 comments on commit 81c7edc

Please sign in to comment.