# HG changeset patch # User Pierre-Yves David # Date 1329747415 -3600 # Node ID 852c73392b0005840401efef1432d6b611f8636a # Parent 25a00e4a8722fa60d8c85684d2a5fc4158083826 [schema] make cubicweb 3.14 compatible with yams 0.35 diff -r 25a00e4a8722 -r 852c73392b00 schema.py --- a/schema.py Wed Feb 22 18:22:02 2012 +0100 +++ b/schema.py Mon Feb 20 15:16:55 2012 +0100 @@ -27,7 +27,7 @@ from logilab.common.decorators import cached, clear_cache, monkeypatch from logilab.common.logging_ext import set_log_methods -from logilab.common.deprecation import deprecated, class_moved +from logilab.common.deprecation import deprecated, class_moved, moved from logilab.common.textutils import splitstrip from logilab.common.graph import get_cycles from logilab.common.compat import any @@ -1250,7 +1250,10 @@ from yams.buildobjs import RichString from yams.constraints import StaticVocabularyConstraint -RichString = class_moved(RichString) +try: # for yams < 0.35 + RichString = class_moved(RichString) +except TypeError: + RichString = moved('yams.buildobjs', 'RichString') StaticVocabularyConstraint = class_moved(StaticVocabularyConstraint) FormatConstraint = class_moved(FormatConstraint)