Skip to content

Commit c4f7cb6

Browse files
committed
only look for regexes in strings
1 parent aefc942 commit c4f7cb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test_elasticsearch/test_server/test_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ def run_match(self, action):
172172
value = self._lookup(path)
173173
expected = self._resolve(expected)
174174

175-
if expected.startswith('/') and expected.endswith('/'):
175+
if isinstance(expected, (type(''), type(u''))) and \
176+
expected.startswith('/') and expected.endswith('/'):
176177
expected = re.compile(expected[1:-1], re.VERBOSE)
177178
self.assertTrue(expected.search(value))
178179
else:

0 commit comments

Comments
 (0)