[py3] import configparser from six.moves instead of using a try/except
Using six is better than the try/except because it clearly indicates
compatibility code. Also, when using tools such as vermin which relies
on AST, it helps getting rid of false compatibility errors.
--- a/cubicweb/pyramid/__init__.py Wed Feb 13 14:40:39 2019 +0100
+++ b/cubicweb/pyramid/__init__.py Tue Mar 05 13:52:52 2019 +0100
@@ -24,6 +24,7 @@
import os
import warnings
+from six.moves.configparser import SafeConfigParser
import wsgicors
from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
@@ -31,11 +32,6 @@
from pyramid.exceptions import ConfigurationError
from pyramid.settings import asbool, aslist
-try:
- from configparser import SafeConfigParser
-except ImportError:
- from ConfigParser import SafeConfigParser
-
def config_from_cwconfig(cwconfig, settings=None):
"""Return a Pyramid Configurator instance built from a CubicWeb config and