From 29cb6cb4f8dfb6b9901f5e0cd9e4ce78d00fb639 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 23 Jan 2019 12:44:08 +0000 Subject: [PATCH] issue #477: Py2.4 startswith() did not support tuples. --- mitogen/ssh.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mitogen/ssh.py b/mitogen/ssh.py index 732f2ffc..f8fe20aa 100644 --- a/mitogen/ssh.py +++ b/mitogen/ssh.py @@ -42,6 +42,11 @@ import mitogen.parent from mitogen.core import b from mitogen.core import bytes_partition +try: + any +except NameError: + from mitogen.core import any + LOG = logging.getLogger('mitogen') @@ -92,7 +97,7 @@ def filter_debug(stream, it): # interesting token from above or the bootstrap # ('password', 'MITO000\n'). break - elif buf.startswith(DEBUG_PREFIXES): + elif any(buf.startswith(p) for p in DEBUG_PREFIXES): state = 'in_debug' else: state = 'in_plain'