Fix flake8 errors/warnings about import in cubicweb/_exceptions.py
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 16 May 2019 09:40:28 +0200
changeset 12613 703a263dd618
parent 12612 f758bc424dc9
child 12614 8ac9ac8d9143
Fix flake8 errors/warnings about import in cubicweb/_exceptions.py We either ignore errors in case of name re-exports and drop re-exports from old backwards compatibility. We fix the only occurrence of NoSelectableObject being imported from cubicweb in tests and update the import to use lgc instead.
cubicweb/_exceptions.py
cubicweb/web/test/unittest_viewselector.py
flake8-ok-files.txt
--- a/cubicweb/_exceptions.py	Thu May 16 04:47:27 2019 +0200
+++ b/cubicweb/_exceptions.py	Thu May 16 09:40:28 2019 +0200
@@ -19,6 +19,7 @@
 
 
 from logilab.common.decorators import cachedproperty
+from logilab.common.registry import RegistryException
 
 from yams import ValidationError  # noqa: F401
 
@@ -148,10 +149,6 @@
 
 # registry exceptions #########################################################
 
-# pre 3.15 bw compat
-from logilab.common.registry import RegistryException, ObjectNotFound, NoSelectableObject
-
-
 class UnknownProperty(RegistryException):
     """property found in database but unknown in registry"""
 
@@ -216,4 +213,4 @@
 
 
 # pylint: disable=W0611
-from logilab.common.clcommands import BadCommandUsage
+from logilab.common.clcommands import BadCommandUsage  # noqa: E402, F401
--- a/cubicweb/web/test/unittest_viewselector.py	Thu May 16 04:47:27 2019 +0200
+++ b/cubicweb/web/test/unittest_viewselector.py	Thu May 16 09:40:28 2019 +0200
@@ -18,13 +18,13 @@
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 """XXX rename, split, reorganize this"""
 
+from logilab.common.registry import NoSelectableObject
 from logilab.common.testlib import unittest_main
 
 from cubicweb.devtools.testlib import CubicWebTC
 from cubicweb import Binary, UnknownProperty
 from cubicweb.predicates import (is_instance,
                                  specified_etype_implements, rql_condition)
-from cubicweb.web import NoSelectableObject
 from cubicweb.web.action import Action
 
 from cubicweb.web.views import (primary, baseviews, tableview,
--- a/flake8-ok-files.txt	Thu May 16 04:47:27 2019 +0200
+++ b/flake8-ok-files.txt	Thu May 16 09:40:28 2019 +0200
@@ -1,5 +1,6 @@
 cubicweb/__init__.py
 cubicweb/__main__.py
+cubicweb/_exceptions.py
 cubicweb/cwctl.py
 cubicweb/cwvreg.py
 cubicweb/dataimport/csv.py