Use ConfigParser instead of SafeConfigParser
The SafeConfigParser class has been renamed to ConfigParser in Python 3.2 [1]. This alias will be removed in future versions.So we can use ConfigParser directly instead. [1] http://bugs.python.org/issue10627 Change-Id: I8cc3bcde108916bda6b8ac95cae9abefe3b5cdee Closes-Bug: #1618666
This commit is contained in:
parent
57c418d05b
commit
618982a091
@ -23,6 +23,7 @@ It is used via a single directive in the .rst file
|
||||
"""
|
||||
import six
|
||||
import six.moves.configparser as config_parser
|
||||
import sys
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers import rst
|
||||
@ -90,7 +91,11 @@ class SupportMatrixDirective(rst.Directive):
|
||||
:returns: SupportMatrix instance
|
||||
"""
|
||||
|
||||
cfg = config_parser.SafeConfigParser()
|
||||
# SafeConfigParser was deprecated in Python 3.2
|
||||
if sys.version_info >= (3, 2):
|
||||
cfg = config_parser.ConfigParser()
|
||||
else:
|
||||
cfg = config_parser.SafeConfigParser()
|
||||
env = self.state.document.settings.env
|
||||
fname = self.options.get("support-matrix",
|
||||
"support-matrix.ini")
|
||||
|
Loading…
x
Reference in New Issue
Block a user