Make cqlsh support python-2.6 (FOLLOW-UP CASSANDRA-10415)

patch by Stefania Alborghetti; reviewed by Benjamin Lerer for CASSANDRA-10415
This commit is contained in:
Stefania Alborghetti 2015-10-22 10:12:04 +02:00 committed by blerer
parent 29ff1f2ac2
commit 5a1d376489
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class CqlParsingRuleSet(pylexotron.ParsingRuleSet):
We cannot let resreved cql keywords be simple 'identifier' since this caused
problems with completion, see CASSANDRA-10415
"""
syntax = '<reserved_identifier> ::= /(' + '|'.join(r'\b{}\b'.format(k) for k in keywords) + ')/ ;'
syntax = '<reserved_identifier> ::= /(' + '|'.join(r'\b%s\b' % (k,) for k in keywords) + ')/ ;'
self.append_rules(syntax)
def completer_for(self, rulename, symname):

View File

@ -76,7 +76,7 @@ class CqlshCompletionCase(BaseTestCase):
# ensure the last line of the completion is the prompt
prompt_regex = self.cqlsh.prompt.lstrip() + re.escape(inputstring)
msg = ('Double-tab completion '
'does not print prompt for input "{}"'.format(inputstring))
'does not print prompt for input "%s"' % (inputstring, ))
self.assertRegexpMatches(choice_lines[-1], prompt_regex, msg=msg)
choice_lines = [line.strip() for line in choice_lines[:-1]]