From 3bdd32ad878b1ff84add1eb63d88e3a7ba301b63 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 23 Oct 2014 16:27:16 +0200 Subject: [PATCH] Always create a module. --- jedi/parser/pytree.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jedi/parser/pytree.py b/jedi/parser/pytree.py index fba05869..9170ae24 100644 --- a/jedi/parser/pytree.py +++ b/jedi/parser/pytree.py @@ -94,9 +94,10 @@ def convert(grammar, raw_node): if type in grammar.number2symbol: # If there's exactly one child, return that child instead of # creating a new node. - # We still create expr_stmt though, because a lot of Jedi depends on - # its logic. - if len(children) == 1 and type != python_symbols.expr_stmt: + # We still create expr_stmt and file_input though, because a lot of + # Jedi depends on its logic. + if len(children) == 1 and type not in (python_symbols.expr_stmt, + python_symbols.file_input): return children[0] #print(raw_node, type_repr(type)) #import pdb; pdb.set_trace()