summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-08-17 12:45:07 -0400
committerJason R. Coombs <jaraco@jaraco.com>2018-08-17 12:45:07 -0400
commit2e3d5465e1a66291ddcb01fb27816750b679492a (patch)
tree77a5f28b2f803a2d9af658eb5048f53fbf81d3b8
parent1ddf030a08fbef0f31cb24fc3e8bc3163ae03e2f (diff)
downloadcherrypy-git-2e3d5465e1a66291ddcb01fb27816750b679492a.tar.gz
Use six for configparser import
-rw-r--r--cherrypy/lib/reprconf.py12
1 files 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.