From 81c7edc1a4561cabc396a4a2ad528e8c78570b71 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sun, 25 Apr 2010 16:42:45 -0700 Subject: [PATCH] patch from Shad Sharma to raise an exception if the transport isn't active when you try to open a new channel. --- paramiko/transport.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/paramiko/transport.py b/paramiko/transport.py index 50e78e7..758ba37 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -706,10 +706,8 @@ class Transport (threading.Thread): @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()