From: Ole Streicher <olebole@debian.org>
Date: Fri, 31 Jan 2020 13:09:57 +0100
Subject: Disable intersphinx mapping for Debian package builds

Closes: #949464
---
 sphinx_astropy/conf/v1.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sphinx_astropy/conf/v1.py b/sphinx_astropy/conf/v1.py
index 993581c..d6f08f3 100644
--- a/sphinx_astropy/conf/v1.py
+++ b/sphinx_astropy/conf/v1.py
@@ -59,6 +59,10 @@ intersphinx_mapping = {
     'h5py': ('https://docs.h5py.org/en/stable/', None),
 }
 
+# Disable intersphinx mapping for Debian package builds
+if 'DH_INTERNAL_BUILDFLAGS' in os.environ:
+    intersphinx_mapping = {}
+
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
 exclude_patterns = ['_build']
