Skip to content

Commit

Permalink
Caught modules which are not importable. This came from applying the …
Browse files Browse the repository at this point in the history
…summarise package to matplotlib.
  • Loading branch information
pelson committed Sep 20, 2013
1 parent fba062f commit 12bdc01
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/cartopy/sphinxext/summarise_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import itertools
import os
import sys

import warnings

import cartopy.tests

Expand Down Expand Up @@ -87,7 +87,11 @@ def objects_to_document(module_name):
(e.g. ``cartopy.io```)
"""
__import__(module_name)
try:
__import__(module_name)
except ImportError:
warnings.warn('Failed to document {}'.format(module_name))
return []
module = sys.modules[module_name]
elems = dir(module)

Expand Down

0 comments on commit 12bdc01

Please sign in to comment.