[predicates] Use proper deprecation mechanisms
authorRémi Cardona <remi.cardona@logilab.fr>
Tue, 09 Jun 2015 12:05:40 +0200
changeset 10381 ef9607fac387
parent 10380 bfd93cbd34a4
child 10382 4831e90b33bb
[predicates] Use proper deprecation mechanisms
predicates.py
--- a/predicates.py	Fri May 22 11:28:56 2015 +0200
+++ b/predicates.py	Tue Jun 09 12:05:40 2015 +0200
@@ -188,6 +188,7 @@
 from warnings import warn
 from operator import eq
 
+from logilab.common.deprecation import deprecated
 from logilab.common.registry import Predicate, objectify_predicate, yes
 
 from yams.schema import BASE_TYPES, role_name
@@ -195,12 +196,10 @@
 
 from cubicweb import (Unauthorized, NoSelectableObject, NotAnEntity,
                       CW_EVENT_MANAGER, role)
-# even if not used, let yes here so it's importable through this module
 from cubicweb.uilib import eid_param
 from cubicweb.schema import split_expression
 
-# remember, these imports are there for bw compat only
-__BACKWARD_COMPAT_IMPORTS = (yes,)
+yes = deprecated('[3.15] import yes() from use logilab.common.registry')(yes)
 
 
 # abstract predicates / mixin helpers ###########################################