diff options
author | Shinya Okano <shinya.okano@beproud.jp> | 2014-05-24 12:33:06 +0900 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2016-12-05 16:47:02 -0800 |
commit | 33aa107e9b9263158b3add78e0f8f0af73b2c08b (patch) | |
tree | 708b4bd942aa9ca0a26fa4a76bfc5c99ce17c0ec | |
parent | 227b98e8240b32c77f40b77b8dcfec514bd60578 (diff) |
Fixes to work on Google App Engine
-rw-r--r-- | paramiko/proxy.py | 6 | ||||
-rw-r--r-- | paramiko/transport.py | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/paramiko/proxy.py b/paramiko/proxy.py index d3ae436f..ea481bca 100644 --- a/paramiko/proxy.py +++ b/paramiko/proxy.py @@ -21,7 +21,11 @@ from datetime import datetime import os from shlex import split as shlsplit import signal -from subprocess import Popen, PIPE +try: + from subprocess import Popen, PIPE +except ImportError: + # Subprocess module doesn't work on Google App Engine. + Popen = PIPE = None from select import select import socket import time diff --git a/paramiko/transport.py b/paramiko/transport.py index cded7bbc..c352246c 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -228,6 +228,7 @@ class Transport (threading.Thread, ClosingContextManager): } _modulus_pack = None + _active_check_timeout = 0.1 def __init__(self, sock, @@ -315,7 +316,7 @@ class Transport (threading.Thread, ClosingContextManager): # we set the timeout so we can check self.active periodically to # see if we should bail. socket.timeout exception is never # propagated. - self.sock.settimeout(0.1) + self.sock.settimeout(self._active_check_timeout) except AttributeError: pass |