Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Instead of wrapping the entire AstropyBuildSphinx definition in a try…

…/except block, add a HAVE_SPHINX global variable a la HAVE_CYTHON; put the AstropyBuildSphinx definition in an if statement instead.
  • Loading branch information...
commit 7f85b89b25a7462a69b3ce189d141d41e6ae7632 1 parent cad977f
@embray embray authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 astropy/setup_helpers.py
View
12 astropy/setup_helpers.py
@@ -35,6 +35,13 @@
HAVE_CYTHON = False
+try:
+ import sphinx
+ HAVE_SPHINX = True
+except ImportError:
+ HAVE_SPHINX = False
+
+
class AstropyBuild(DistutilsBuild):
"""
A custom 'build' command that allows for adding extra build
@@ -192,7 +199,7 @@ def run(self):
AstropyInstall.add_install_option(*option)
-try:
+if HAVE_SPHINX:
from sphinx.setup_command import BuildDoc
class AstropyBuildSphinx(BuildDoc):
@@ -325,9 +332,6 @@ def run(self):
AstropyBuildSphinx.__name__ = 'build_sphinx'
-except ImportError:
- AstropyBuildSphinx = None
-
def get_distutils_display_options():
""" Returns a set of all the distutils display options in their long and
Please sign in to comment.
Something went wrong with that request. Please try again.