Commits

Georg Brandl  committed b6b3c40

Fix intersphinx for installations without urllib2.HTTPSHandler.

  • Participants
  • Parent commits 8e5bddc

Comments (0)

Files changed (2)

 Release 0.6.2 (in development)
 ==============================
 
+* Fix intersphinx for installations without urllib2.HTTPSHandler.
+
 * #134: Fix pending_xref leftover nodes when using the todolist
   directive from the todo extension.
 

File sphinx/ext/intersphinx.py

 
 from sphinx.builders.html import INVENTORY_FILENAME
 
+handlers = [urllib2.ProxyHandler(), urllib2.HTTPRedirectHandler(),
+            urllib2.HTTPHandler()]
+if hasattr(urllib2, 'HTTPSHandler'):
+    handlers.append(urllib2.HTTPSHandler)
 
-urllib2.install_opener(urllib2.build_opener(
-    urllib2.ProxyHandler(), urllib2.HTTPRedirectHandler(),
-    urllib2.HTTPHandler(), urllib2.HTTPSHandler()))
+urllib2.install_opener(urllib2.build_opener(*handlers))
 
 
 def fetch_inventory(app, uri, inv):