Use ConfigParser instead of SafeConfigParser
in Python 3 The SafeConfigParser class has been renamed to ConfigParser in Python 3.2 [1]. The alias SafeConfigParser maybe removed in future versions of Python 3. Use ConfigParser instead of SafeConfigParser in Python 3.We're switching from SafeConfigParser to ConfigParser because we're we're not explicitly using the 'Safe' functionality.So it make the code potentially neater if SafeConfigParser is even de-aliased in python3. [1] http://bugs.python.org/issue10627 Change-Id: I932ced300a93040144e89c7f4acc95480b32749d
This commit is contained in:
parent
b3b2e65fa4
commit
9d890b2856
@ -19,6 +19,7 @@ import collections
|
||||
import errno
|
||||
import io
|
||||
import os
|
||||
|
||||
from six.moves import configparser
|
||||
|
||||
from parsley import makeGrammar
|
||||
@ -57,7 +58,7 @@ def extras(project):
|
||||
"""Return a dict of extra-name:content for the extras in setup.cfg."""
|
||||
if 'setup.cfg' not in project:
|
||||
return {}
|
||||
c = configparser.SafeConfigParser()
|
||||
c = configparser.ConfigParser()
|
||||
c.readfp(io.StringIO(project['setup.cfg']))
|
||||
if not c.has_section('extras'):
|
||||
return {}
|
||||
|
Loading…
Reference in New Issue
Block a user