# HG changeset patch # User Denis Laxalde # Date 1557992428 -7200 # Node ID 703a263dd61832f713104a244c2c4adf149a4f22 # Parent f758bc424dc97c695f44edeea5ca28db53ec3599 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. diff -r f758bc424dc9 -r 703a263dd618 cubicweb/_exceptions.py --- 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 diff -r f758bc424dc9 -r 703a263dd618 cubicweb/web/test/unittest_viewselector.py --- 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 . """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, diff -r f758bc424dc9 -r 703a263dd618 flake8-ok-files.txt --- 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