D6641: py3: source-transform only call-sites of iteritems(), not definitions

Yuya Nishihara yuya at tcha.org
Mon Jul 15 19:38:25 EDT 2019


> --- a/mercurial/__init__.py
> +++ b/mercurial/__init__.py
> @@ -225,7 +225,9 @@
>  
>                  # It changes iteritems/values to items/values as they are not
>                  # present in Python 3 world.
> -                elif fn in ('iteritems', 'itervalues'):
> +                elif (fn in ('iteritems', 'itervalues') and
> +                      not (tokens[i - 1].type == token.NAME and
> +                           tokens[i - 1].string == 'def')):

Perhaps, we need to bump the BYTECODEHEADER version to recompile all
py3 modules.


More information about the Mercurial-devel mailing list