File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 2121
2222import sys
2323import os
24- from configparser import ConfigParser
24+ try :
25+ from configparser import ConfigParser
26+ except ImportError :
27+ from ConfigParser import ConfigParser # PY2
2528
2629# Check for external Sphinx extensions we depend on
2730try :
5962# Load metadata from setup.cfg
6063config = ConfigParser ()
6164config .read (os .path .join ('..' , '..' , 'setup.cfg' ))
65+ try :
66+ metadata = config ['metadata' ]
67+ except AttributeError :
68+ metadata = dict (config .items ('metadata' )) # PY2
6269
6370# Add any Sphinx extension module names here, as strings. They can be
6471# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
9299
93100# General information about the project.
94101project = u'NiBabel'
95- copyright = u'2006-2019, %(maintainer)s <%(author_email)s>' % config [ ' metadata' ]
102+ copyright = u'2006-2019, %(maintainer)s <%(author_email)s>' % metadata
96103
97104# The version info for the project you're documenting, acts as replacement for
98105# |version| and |release|, also used in various other places throughout the
You can’t perform that action at this time.
0 commit comments