# HG changeset patch # User Aurelien Campeas # Date 1381401730 -7200 # Node ID c964d8cf6efc96f85080f56329df518c88fc0812 # Parent ae3fd6f8da7605134a158a7b22a400fe7ca68484 [entity] do not raise an AssertionError if the kwargs given to set_relations/attributes is empty Regression was introduced in 3.16 with the new cw_set API. Old set_relations and set_attributes methods did not crash on empty kwargs. Closes #3104019. diff -r ae3fd6f8da76 -r c964d8cf6efc entity.py --- a/entity.py Thu Oct 10 12:30:35 2013 +0200 +++ b/entity.py Thu Oct 10 12:42:10 2013 +0200 @@ -1321,7 +1321,8 @@ @deprecated('[3.16] use cw_set() instead of set_attributes()') def set_attributes(self, **kwargs): # XXX cw_set_attributes - self.cw_set(**kwargs) + if kwargs: + self.cw_set(**kwargs) @deprecated('[3.16] use cw_set() instead of set_relations()') def set_relations(self, **kwargs): # XXX cw_set_relations @@ -1332,7 +1333,8 @@ (meaning that all relations of the given type from or to this object should be deleted). """ - self.cw_set(**kwargs) + if kwargs: + self.cw_set(**kwargs) @deprecated('[3.13] use entity.cw_clear_all_caches()') def clear_all_caches(self):