Mercurial > sqlpython
changeset 113:d48034a42b26
slash-endings working
author | catherine@Elli.myhome.westell.com |
---|---|
date | Mon, 23 Jun 2008 22:01:51 -0400 |
parents | 5e57765073f4 |
children | c1c05670b4e5 |
files | sqlpyPlus.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/sqlpyPlus.py Mon Jun 23 20:52:27 2008 -0400 +++ b/sqlpyPlus.py Mon Jun 23 22:01:51 2008 -0400 @@ -479,7 +479,7 @@ pyparsing.Literal('\\C') + rowlimit_pattern, pyparsing.Literal('\\h') + rowlimit_pattern, pyparsing.Literal('\\t') + rowlimit_pattern, - '\n\n' + pyparsing.LineEnd() + '/' + pyparsing.LineEnd() ] tableNameFinder = re.compile(r'from\s+([\w$#_"]+)', re.IGNORECASE | re.MULTILINE | re.DOTALL) def output(self, outformat, rowlimit): @@ -540,10 +540,10 @@ (self.query, terminator, dummy) = terminator else: terminator = [';'] - if len(terminator) == 1: + try: + terminator, rowlimit = terminator[0], int(terminator[1]) + except (IndexError, ValueError): terminator, rowlimit = terminator[0], 0 - else: - terminator, rowlimit = terminator[0], int(terminator[1]) if override_terminator: terminator = override_terminator try: