Merge "Fix SafeConfigParser DeprecationWarning in Python 3.2"
This commit is contained in:
@@ -21,6 +21,7 @@ It is used via a single directive in the .rst file
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
from six.moves import configparser
|
from six.moves import configparser
|
||||||
|
|
||||||
@@ -158,7 +159,11 @@ class FeatureMatrixDirective(rst.Directive):
|
|||||||
:returns: Matrix instance
|
:returns: Matrix instance
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cfg = configparser.SafeConfigParser()
|
# SafeConfigParser was deprecated in Python 3.2
|
||||||
|
if sys.version_info >= (3, 2):
|
||||||
|
cfg = configparser.ConfigParser()
|
||||||
|
else:
|
||||||
|
cfg = configparser.SafeConfigParser()
|
||||||
env = self.state.document.settings.env
|
env = self.state.document.settings.env
|
||||||
filename = self.arguments[0]
|
filename = self.arguments[0]
|
||||||
rel_fpath, fpath = env.relfn2path(filename)
|
rel_fpath, fpath = env.relfn2path(filename)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ It is used via a single directive in the .rst file
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from six.moves import configparser
|
from six.moves import configparser
|
||||||
@@ -129,7 +130,11 @@ class SupportMatrixDirective(rst.Directive):
|
|||||||
:returns: SupportMatrix instance
|
:returns: SupportMatrix instance
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cfg = configparser.SafeConfigParser()
|
# SafeConfigParser was deprecated in Python 3.2
|
||||||
|
if sys.version_info >= (3, 2):
|
||||||
|
cfg = configparser.ConfigParser()
|
||||||
|
else:
|
||||||
|
cfg = configparser.SafeConfigParser()
|
||||||
env = self.state.document.settings.env
|
env = self.state.document.settings.env
|
||||||
fname = self.arguments[0]
|
fname = self.arguments[0]
|
||||||
rel_fpath, fpath = env.relfn2path(fname)
|
rel_fpath, fpath = env.relfn2path(fname)
|
||||||
|
|||||||
Reference in New Issue
Block a user