From 7b1c35c3ed841b7a2a629ec04189e972dd057b34 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 22 Jan 2014 16:33:00 +0100 Subject: [PATCH] fix python 3 issues with the new interpreter implementation --- jedi/api/interpreter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jedi/api/interpreter.py b/jedi/api/interpreter.py index 8724a45d..374c4797 100644 --- a/jedi/api/interpreter.py +++ b/jedi/api/interpreter.py @@ -1,4 +1,5 @@ import inspect +import re from jedi._compatibility import builtins from jedi import debug @@ -63,9 +64,10 @@ class LazyName(helpers.FakeName): except AttributeError: pass else: - if path.endswith('.pyc'): + path = re.sub('c$', '', path) + if path.endswith('.py'): # cut the `c` from `.pyc` - with open(path[:-1]) as f: + with open(path) as f: mod = FastParser(f.read(), path[:-1]).module if not parser_path: return mod