From ac2b0016d51997a34e10582522ba82b1b19d618d Mon Sep 17 00:00:00 2001 From: David Halter Date: Mon, 14 Jan 2013 21:25:48 +0100 Subject: [PATCH] fix import problems with negative kill_counts, fixes #111 --- jedi/imports.py | 2 +- test/regression.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/jedi/imports.py b/jedi/imports.py index 7563dcdb..010c66c4 100644 --- a/jedi/imports.py +++ b/jedi/imports.py @@ -46,7 +46,7 @@ class ImportPath(parsing.Base): self.import_stmt = import_stmt self.is_like_search = is_like_search self.direct_resolve = direct_resolve - self.is_partial_import = bool(kill_count) + self.is_partial_import = bool(max(0, kill_count)) path = import_stmt.get_parent_until().path self.file_path = os.path.dirname(path) if path is not None else None diff --git a/test/regression.py b/test/regression.py index a5242fa9..faecfd79 100755 --- a/test/regression.py +++ b/test/regression.py @@ -121,7 +121,6 @@ class TestRegression(TestBase): # 111 assert self.complete("from datetime import") == [] - print self.complete("from datetime import ") assert self.complete("from datetime import ") def test_get_in_function_call(self):