[gnome-builder/wip/elad/jedi-fixes: 1/2] jedi: work around a bug in Jedi to improve completion in some cases
- From: Elad Alfassa <eladalfassa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/elad/jedi-fixes: 1/2] jedi: work around a bug in Jedi to improve completion in some cases
- Date: Mon, 24 Aug 2015 20:22:36 +0000 (UTC)
commit 6961947a7cb7b5dfc23713b3e1a16f6f1552afbd
Author: Elad Alfassa <elad fedoraproject org>
Date: Mon Aug 24 22:55:41 2015 +0300
jedi: work around a bug in Jedi to improve completion in some cases
This makes
foo = Gtk.Window()
foo.
actually return completions for GtkWindow
plugins/jedi/jedi_plugin.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
index 9305f71..9c80011 100644
--- a/plugins/jedi/jedi_plugin.py
+++ b/plugins/jedi/jedi_plugin.py
@@ -55,6 +55,18 @@ try:
pass
return module_list
+ original_jedi_get_module = jedi.evaluate.compiled.fake.get_module
+
+ def patched_jedi_get_module(obj):
+ "Work around a weird bug in jedi"
+ try:
+ return original_jedi_get_module(obj)
+ except ImportError as e:
+ if e.msg == "No module named 'gi._gobject._gobject'":
+ return original_jedi_get_module('gi._gobject')
+
+ jedi.evaluate.compiled.fake.get_module = patched_jedi_get_module
+
jedi.evaluate.imports.Importer = PatchedJediImporter
HAS_JEDI = True
except ImportError:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]