Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed compatibility with Sphinx < 1.0 workarounds in our extension …

…code. Also, started to use the 'needs_sphinx' Sphinx config var.

Follow up on r14624.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14631 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f60930634978e49e97112fc4253f4a5d425c9950 1 parent c0adc62
Ramiro Morales authored
10  docs/_ext/djangodocs.py
@@ -83,10 +83,7 @@ def run(self):
83 83
         if not is_nextversion:
84 84
             if len(self.arguments) == 1:
85 85
                 linktext = 'Please, see the release notes </releases/%s>' % (arg0)
86  
-                try:
87  
-                    xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, self.state) # Sphinx >= 1.0
88  
-                except AttributeError:
89  
-                    xrefs = roles.xfileref_role('doc', linktext, linktext, self.lineno, self.state) # Sphinx < 1.0
  86
+                xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, self.state)
90 87
                 node.extend(xrefs[0])
91 88
             node['version'] = arg0
92 89
         else:
@@ -196,10 +193,7 @@ def parse_django_admin_node(env, sig, signode):
196 193
 
197 194
 def parse_django_adminopt_node(env, sig, signode):
198 195
     """A copy of sphinx.directives.CmdoptionDesc.parse_signature()"""
199  
-    try:
200  
-        from sphinx.domains.std import option_desc_re # Sphinx >= 1.0
201  
-    except ImportError:
202  
-        from sphinx.directives.desc import option_desc_re # Sphinx < 1.0
  196
+    from sphinx.domains.std import option_desc_re
203 197
     count = 0
204 198
     firstname = ''
205 199
     for m in option_desc_re.finditer(sig):
2  docs/conf.py
@@ -22,7 +22,7 @@
22 22
 # -- General configuration -----------------------------------------------------
23 23
 
24 24
 # If your documentation needs a minimal Sphinx version, state it here.
25  
-#needs_sphinx = '1.0'
  25
+needs_sphinx = '1.0'
26 26
 
27 27
 # Add any Sphinx extension module names here, as strings. They can be extensions
28 28
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.

0 notes on commit f609306

Please sign in to comment.
Something went wrong with that request. Please try again.