[py-dev] Bug with py.test when object repr contains "\n"

holger krekel hpk at trillke.net
Wed Jun 1 16:52:39 CEST 2005


Hi Jan, 

On Wed, Jun 01, 2005 at 16:46 +0200, Jan Balster wrote:
> Pierre Barbier de Reuille wrote:
> 
> Hi Pierre,
> 
> here is a quick patch to fix your problem.
> The patch doesn't break any py-lib test but perhaps some tests in pypy.
> 
> I won't commit the patch to the trunk unless I am sure it won't break
> anything. Perhaps Holger will do ;-)

such types of patches should not hamper PyPy.  But it would be good 
to have a test for the actual problem that the patch intends to 
fix.  Otherwise feel free to commit. 

cheers, 

    holger

> Patch:
> 
> --- exprinfo.py (revision 12973)
> +++ exprinfo.py (working copy)
> @@ -61,11 +61,13 @@
>                  stackcnt[-1] += 1
>                  stackcnt.append(0)
>                  result.append(' +' + '  '*(len(stack)-1) + s + line[1:])
> -            else:
> +            elif line.startswith('}'):
>                  assert line.startswith('}')
>                  stack.pop()
>                  stackcnt.pop()
>                  result[stack[-1]] += line[1:]
> +            else:
> +                result.append(' '* len(result[-1])+ line)
>          assert len(stack) == 1
>          return '\n'.join(result)
> 
> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev
> 


More information about the py-dev mailing list