From 89501e6fa59f2405f4df93100c0b65672bd057fa Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 23 May 2017 14:13:52 -0400 Subject: [PATCH] Fix an error_recovery/file_input check. --- parso/grammar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parso/grammar.py b/parso/grammar.py index 67aee46..4a1697e 100644 --- a/parso/grammar.py +++ b/parso/grammar.py @@ -30,7 +30,7 @@ class Grammar(object): you will get a ParseError when encountering syntax errors in your code. :param start_symbol str: The grammar symbol that you want to parse. Only - allowed to be used when error_recovery is disabled. + allowed to be used when error_recovery is False. :param cache bool: A Python grammar file, created with load_grammar. You may not specify it. In that case it's the current Python version. :param diff_cache bool: Diffs the cached python module against the new @@ -55,7 +55,7 @@ class Grammar(object): """ if code is None and path is None: raise TypeError("Please provide either code or a path.") - if error_recovery and start_symbol: + if error_recovery and start_symbol != 'file_input': raise NotImplementedError("This is currently not implemented.") if cache and code is None and path is not None: