wintest Allow substitute to cope with objects like pexpect.EOF
authorAndrew Bartlett <abartlet@samba.org>
Mon, 22 Nov 2010 10:24:56 +0000 (21:24 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Nov 2010 06:46:07 +0000 (07:46 +0100)
These are not strings, but may get passed into this function on the
way to pexpect.

Andrew Bartlett

wintest/wintest.py

index a43059975d04b826a110e5422c6d7c7311c3b23c..15b95bb1f5895ae90bc6002d342bd6b28b31ffaa 100644 (file)
@@ -70,6 +70,9 @@ class wintest():
                 ret[i] = self.substitute(ret[i])
             return ret
 
+        """We may have objects such as pexpect.EOF that are not strings"""
+        if not isinstance(text, str):
+            return text
         while True:
             var_start = text.find("${")
             if var_start == -1: