From 3f0263730488e2858a5bfef56a0a4e57b289319d Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Thu, 26 Aug 2010 15:25:58 +0200 Subject: Check for None values in options dict, reported by Marco44. See http://groups.google.com/group/sqlparse/browse_thread/thread/2acecd715a48a169 The default options for identifiers and keywords (to do nothing) got lost since both are in the options dict, but with None as value. --- sqlparse/formatter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sqlparse') diff --git a/sqlparse/formatter.py b/sqlparse/formatter.py index c03e9a9..5be6652 100644 --- a/sqlparse/formatter.py +++ b/sqlparse/formatter.py @@ -76,11 +76,11 @@ def build_filter_stack(stack, options): options: Dictionary with options validated by validate_options. """ # Token filter - if 'keyword_case' in options: + if options.get('keyword_case', None): stack.preprocess.append( filters.KeywordCaseFilter(options['keyword_case'])) - if 'identifier_case' in options: + if options.get('identifier_case', None): stack.preprocess.append( filters.IdentifierCaseFilter(options['identifier_case'])) -- cgit v1.2.1