[PATCH 3 of 3] inotify: Do not raise TypeError when client.query returns None

Benoit Boissinot benoit.boissinot at ens-lyon.org
Tue Apr 14 11:42:27 CDT 2009


On Wed, Apr 08, 2009 at 02:18:00PM +0900, Nicolas Dumazet wrote:
> # HG changeset patch
> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
> # Date 1239167718 -32400
> # Node ID 8c69a6f7ff772397b26d8a71da2b1787b6adcace
> # Parent  d618b5fbddedfca6c4598cb6ac221de065faa71b
> inotify: Do not raise TypeError when client.query returns None

Queued (8069:82e28c7be8fb).

Should client.query() raise an exception instead ?

regards,

Benoit
> 
> When something went wrong in client.query, it returns None.
> If inotify.debug=True, we will attempt in this case a zip(A, None, B), which
> would raise a TypeError.
> 
> diff --git a/hgext/inotify/__init__.py b/hgext/inotify/__init__.py
> --- a/hgext/inotify/__init__.py
> +++ b/hgext/inotify/__init__.py
> @@ -58,7 +58,7 @@
>                  if not ignored and not self.inotifyserver:
>                      result = client.query(ui, repo, files, match, False,
>                                            clean, unknown)
> -                    if ui.config('inotify', 'debug'):
> +                    if result and ui.config('inotify', 'debug'):
>                          r2 = super(inotifydirstate, self).status(
>                              match, False, clean, unknown)
>                          for c,a,b in zip('LMARDUIC', result, r2):

-- 
:wq


More information about the Mercurial-devel mailing list