From 4a34d989671badd7a443859ec09a874010226b21 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Tue, 20 Nov 2012 12:07:48 +0100 Subject: [PATCH] Ignore IOError when checking Python file Emacs uses a symbolic link to non-existing file for locking file. It has the same extension as the original file. Therefore, Jedi must ignore IOError when trying to open this symbolic file. --- jedi/dynamic.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jedi/dynamic.py b/jedi/dynamic.py index 5b686ee8..e06d35c6 100644 --- a/jedi/dynamic.py +++ b/jedi/dynamic.py @@ -33,7 +33,10 @@ def get_directory_modules_for_name(mods, name): try: return builtin.CachedModule.cache[path][1].module except KeyError: - return check_fs(path) + try: + return check_fs(path) + except IOError: + return None def check_fs(path): with open(path) as f: