[PATCH] util: kill Python 2.4 deque.remove hack

Martin von Zweigbergk martinvonz at google.com
Sat May 16 13:33:09 CDT 2015


I've pushed this to the clowncopter, thanks. Will send my follow-up patch
once this patch is in Matt's repo.

On Sat, May 16, 2015 at 1:52 AM Adrian Buehlmann <adrian at cadifra.com> wrote:

> # HG changeset patch
> # User Adrian Buehlmann <adrian at cadifra.com>
> # Date 1431759801 -7200
> # Node ID 3d14c1217117795e3b792369224ed7fa68e31123
> # Parent  1ef96a3b8b89a896f2c9f3f977dbef8f45bb0e26
> util: kill Python 2.4 deque.remove hack
>
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -334,17 +334,7 @@
>
>      return f
>
> -try:
> -    collections.deque.remove
> -    deque = collections.deque
> -except AttributeError:
> -    # python 2.4 lacks deque.remove
> -    class deque(collections.deque):
> -        def remove(self, val):
> -            for i, v in enumerate(self):
> -                if v == val:
> -                    del self[i]
> -                    break
> +deque = collections.deque
>
>  class sortdict(dict):
>      '''a simple sorted dictionary'''
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150516/8b5d110a/attachment.html>


More information about the Mercurial-devel mailing list