From 478acf8ccf0f0ac8218e0e981c53194d7b32e3bc Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 4 Dec 2014 14:29:37 +0100 Subject: [PATCH] partial is working partially now with the new parser, because invalid statements are not possible anymore (two times **kwargs) --- jedi/evaluate/compiled/fake/_functools.pym | 3 ++- jedi/evaluate/helpers.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jedi/evaluate/compiled/fake/_functools.pym b/jedi/evaluate/compiled/fake/_functools.pym index a4b1ebb1..909ef03f 100644 --- a/jedi/evaluate/compiled/fake/_functools.pym +++ b/jedi/evaluate/compiled/fake/_functools.pym @@ -5,4 +5,5 @@ class partial(): self.__keywords = keywords def __call__(self, *args, **kwargs): - return self.__func(*(self.__args + args), **dict(self.__keywords, **kwargs)) + # TODO should be **dict(self.__keywords, **kwargs) + return self.__func(*(self.__args + args), **self.__keywords) diff --git a/jedi/evaluate/helpers.py b/jedi/evaluate/helpers.py index cad9873d..fe2d0521 100644 --- a/jedi/evaluate/helpers.py +++ b/jedi/evaluate/helpers.py @@ -104,7 +104,10 @@ def deep_ast_copy(obj, new_elements_default=None, check_first=False): # TODO this sucks... we need to change it. # DOESNT WORK for unfinished in unfinished_parents: - unfinished.parent = new_elements[unfinished.parent] + try: + unfinished.parent = new_elements[unfinished.parent] + except KeyError: # TODO this keyerror is useless. + pass return result