From 53925ab3cc628a4aa4c82ab02593171ccb368b53 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 18 Dec 2012 19:07:53 +0000 Subject: [PATCH] Watch out for ImportErrors when getting attributers from an object (it may be a pseudo module that will try to import other modules.) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- sphinxtools/modulehunter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sphinxtools/modulehunter.py b/sphinxtools/modulehunter.py index a4b43d07..b0d4f403 100644 --- a/sphinxtools/modulehunter.py +++ b/sphinxtools/modulehunter.py @@ -342,6 +342,11 @@ def describe_class(obj, module_class, module_name, constants): except AttributeError: # Thanks to ReportLab for this funny exception... continue + except ImportError: + # This can come from the pseudo module in wx.lib.six + message = "ImportError from '%s.%s'.\n Exception was: %s"%(obj, name, format_traceback()) + print(('\nWARNING: %s\n' % message)) + continue if ismodule(item): continue