[PATCH 2 of 2] py3: use iter() instead of iterkeys()
Pulkit Goyal
7895pulkit at gmail.com
Wed Mar 15 05:44:01 EDT 2017
The series LGTM as I also have the same patches locally.
On Wed, Mar 15, 2017 at 3:05 PM, Rishabh Madan <rishabhmadan96 at gmail.com>
wrote:
> # HG changeset patch
> # User Rishabh Madan <rishabhmadan96 at gmail.com>
> # Date 1489569941 -19800
> # Wed Mar 15 14:55:41 2017 +0530
> # Node ID c289886e8c1fd3df6b72f7019e930494ecc4c3b0
> # Parent 1ada79790380d3f9e416780f6447b383cc18f817
> py3: use iter() instead of iterkeys()
>
> The iterkeys() method has been deprecated for python3. This patch uses
> iter()
> over dict.keys() to get the iterator object.
>
> diff -r 1ada79790380 -r c289886e8c1f mercurial/util.py
> --- a/mercurial/util.py Wed Mar 15 14:51:18 2017 +0530
> +++ b/mercurial/util.py Wed Mar 15 14:55:41 2017 +0530
> @@ -2918,7 +2918,10 @@
> del dirs[base]
>
> def __iter__(self):
> - return self._dirs.iterkeys()
> + if pycompat.ispy3:
> + return iter(self._dirs.keys())
> + else:
> + return self._dirs.iterkeys()
>
> def __contains__(self, d):
> return d in self._dirs
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170315/b99d45fa/attachment.html>
More information about the Mercurial-devel
mailing list