From bdc2f291ca32093d390ad65644fb06cd6762b753 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 26 Aug 2016 19:32:51 +0100 Subject: [PATCH] Some importers don't implement all the optional interfaces. --- econtext/master.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/econtext/master.py b/econtext/master.py index 20e9324f..51241c07 100644 --- a/econtext/master.py +++ b/econtext/master.py @@ -101,10 +101,13 @@ class ModuleResponder(object): if not loader: return - path = loader.get_filename(fullname) - source = loader.get_source(fullname) - if path is not None and source is not None: - return path, source, loader.is_package(fullname) + try: + path = loader.get_filename(fullname) + source = loader.get_source(fullname) + if path is not None and source is not None: + return path, source, loader.is_package(fullname) + except AttributeError: + return def _get_module_via_sys_modules(self, fullname): """Attempt to fetch source code via sys.modules. This is specifically