Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:davidhalter/jedi into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhalter committed Oct 6, 2014
2 parents e9a3a44 + 90d159e commit 09a7317
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jedi/evaluate/compiled/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,14 @@ def load_module(path, name):
sys_path.insert(0, p)

temp, sys.path = sys.path, sys_path
__import__(dotted_path)
try:
__import__(dotted_path)
except RuntimeError:
if 'PySide' in dotted_path or 'PyQt' in dotted_path:
# RuntimeError: the PyQt4.QtCore and PyQt5.QtCore modules both wrap
# the QObject class.
# See https://github.com/davidhalter/jedi/pull/483
return None
# Just access the cache after import, because of #59 as well as the very
# complicated import structure of Python.
module = sys.modules[dotted_path]
Expand Down
3 changes: 3 additions & 0 deletions jedi/evaluate/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ def follow(self, is_goto=False):
analysis.add(self._evaluator, 'import-error', e.name_part)
return []

if module is None:
return []

if self.import_stmt.is_nested() and not self.nested_resolve:
scopes = [NestedImportModule(module, self.import_stmt)]
else:
Expand Down

0 comments on commit 09a7317

Please sign in to comment.