summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2014-11-30 07:03:58 +0100
committerAndi Albrecht <albrecht.andi@gmail.com>2014-11-30 07:03:58 +0100
commit223606e484c9bc02db46f83b8cdf288e2a7cafe6 (patch)
tree07e8d38f47fc43b070e0d36328ca48d0c4b71ab5 /sqlparse
parent1ced2da0d4c733ba440d263cfccc13971a3c8afe (diff)
downloadsqlparse-223606e484c9bc02db46f83b8cdf288e2a7cafe6.tar.gz
Make formatter a bit more robust (fixes issue121).
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/filters.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sqlparse/filters.py b/sqlparse/filters.py
index 5a613a0..bf65a4a 100644
--- a/sqlparse/filters.py
+++ b/sqlparse/filters.py
@@ -352,7 +352,10 @@ class ReindentFilter:
def _process_where(self, tlist):
token = tlist.token_next_match(0, T.Keyword, 'WHERE')
- tlist.insert_before(token, self.nl())
+ try:
+ tlist.insert_before(token, self.nl())
+ except ValueError: # issue121, errors in statement
+ pass
self.indent += 1
self._process_default(tlist)
self.indent -= 1