# HG changeset patch # User Julien Cristau # Date 1452090479 -3600 # Node ID eba98431f705b093781ccac41420c2594159f922 # Parent 881b3d9ee2b301329cfcb341093e8898bb2097e4 [devtools] "fix" boundary condition for autofill maxvalue in an IntervalBoundConstraint is inclusive. If the min and max values happened to coincide, we would call random.choice on an empty list, which it didn't like. This is still broken in the case of BoundaryConstraint('>', minvalue), as we assume the minvalue is in the range, but that's something for another time. diff -r 881b3d9ee2b3 -r eba98431f705 devtools/fill.py --- a/devtools/fill.py Thu Jan 28 18:02:49 2016 +0100 +++ b/devtools/fill.py Wed Jan 06 15:27:59 2016 +0100 @@ -42,6 +42,9 @@ from cubicweb.schema import RQLConstraint def custom_range(start, stop, step): + if start == stop: + yield start + return while start < stop: yield start start += step