From 2e3d5465e1a66291ddcb01fb27816750b679492a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 17 Aug 2018 12:45:07 -0400 Subject: Use six for configparser import --- cherrypy/lib/reprconf.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cherrypy/lib/reprconf.py b/cherrypy/lib/reprconf.py index 19b6511a..c0dba34e 100644 --- a/cherrypy/lib/reprconf.py +++ b/cherrypy/lib/reprconf.py @@ -19,18 +19,12 @@ and the handler must be either a callable or a context manager. """ from cherrypy._cpcompat import text_or_bytes - -try: - # Python 3.0+ - from configparser import ConfigParser -except ImportError: - from ConfigParser import ConfigParser +from six.moves import configparser +from six.moves import builtins import operator as _operator import sys -from six.moves import builtins - class NamespaceSet(dict): @@ -152,7 +146,7 @@ class Config(dict): self.namespaces({k: v}) -class Parser(ConfigParser): +class Parser(configparser.ConfigParser): """Sub-class of ConfigParser that keeps the case of options and that raises an exception if the file cannot be read. -- cgit v1.2.1