patch from Shad Sharma to raise an exception if the transport isn't active when you try to open a new channel.
This commit is contained in:
parent
188c82eede
commit
81c7edc1a4
|
@ -706,10 +706,8 @@ class Transport (threading.Thread):
|
||||||
@raise SSHException: if the request is rejected or the session ends
|
@raise SSHException: if the request is rejected or the session ends
|
||||||
prematurely
|
prematurely
|
||||||
"""
|
"""
|
||||||
chan = None
|
|
||||||
if not self.active:
|
if not self.active:
|
||||||
# don't bother trying to allocate a channel
|
raise SSHException('SSH session not active')
|
||||||
return None
|
|
||||||
self.lock.acquire()
|
self.lock.acquire()
|
||||||
try:
|
try:
|
||||||
chanid = self._next_channel()
|
chanid = self._next_channel()
|
||||||
|
|
Loading…
Reference in New Issue