Comment 3 for bug 802352

Revision history for this message
xrg (xrg) wrote : Re: [Bug 802352] Re: [6.0] Inheriting _constraints "list index out of range" if original len(_constraint ) is bigger than the new one

On Monday 27 June 2011, you wrote:
> ** Patch added: "Patch for problem"
>
> https://bugs.launchpad.net/bugs/802352/+attachment/2182312/+files/patch_co
> nstraints.diff

Hi,
for that piece of code you mention, I should be held responsible, I wrote it.

But I can't understand your patch:
you seem to do an iteration over 'c', I don't understand why.

At line osv.py:347, there is:
   for c in cls.__dict__.get(s, []):
which should iterate over the "_constraints" list. So, 'c' should point to
just one constraint (3-item tuple)

Are you sure your constraints are in the form of:
    _constraints = [ ('foo', 'bar', 'expl'), ('foo2', 'bar2', 'expl2') ]

and NOT accidentally like
   _constraints = [ ('foo', 'bar', 'expl'), [ ('foo2', 'bar2', 'expl2'), ], ]

???

--
Say NO to spam and viruses. Stop using Microsoft Windows!