From 9d890b28564e873acfdd1fa067e6be3ad3dc5998 Mon Sep 17 00:00:00 2001 From: gengchc2 Date: Fri, 23 Sep 2016 14:35:46 +0800 Subject: [PATCH] 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 --- openstack_requirements/project.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack_requirements/project.py b/openstack_requirements/project.py index 8c9e61d4d7..a401ac9b69 100644 --- a/openstack_requirements/project.py +++ b/openstack_requirements/project.py @@ -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 {}