[PATCH 7 of 8] py3: make tests/readlink.py use print_function

timeless timeless at gmail.com
Mon May 16 12:35:15 EDT 2016


timeless <timeless at gmail.com> wrote:
> This is wrong. I know because my series actually exercises it.

fwiw, committed has 5e0077e9c6c0 -- the correct commit for this, so
you can drop this from your series (or the reviewers can).

When you run through the code, it eventually makes sense (or at least
it did to me, and I'm sure it will to you) why the obvious transition
doesn't actually work.

For people reviewing print_function work, this specific change is worth noting:

try:
  print a, foo(b)
except e:
  print foo2(b)

will not be the same as:
from __future__ import print_function
try:
  print(a, foo(b))
except e:
  print(foo2(b))

because in the former, a is printed before foo(b) is evaluated, in the
latter, foo(b) is evaluated before the print function is called, and
thus nothing is printed when foo(b) throws.


More information about the Mercurial-devel mailing list