From c2a933ea31cac582dc54a99eb63af3b62b41a93c Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 25 Apr 2017 22:01:01 -0700 Subject: [PATCH] Check for None before accessing 'tok' --- yapf/yapflib/format_decision_state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yapf/yapflib/format_decision_state.py b/yapf/yapflib/format_decision_state.py index 1e27bb166..c258cfdd3 100644 --- a/yapf/yapflib/format_decision_state.py +++ b/yapf/yapflib/format_decision_state.py @@ -214,7 +214,7 @@ def MustSplit(self): tok = current.next_token while tok and (tok.is_name or tok.value == '.'): tok = tok.next_token - func_call_or_string_format = tok.value == '(' + func_call_or_string_format = tok and tok.value == '(' elif current.is_string: tok = current.next_token while tok and tok.is_string: