[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] trace: avoid "is" with a literal Python 3.8 warnings
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH] trace: avoid "is" with a literal Python 3.8 warnings |
Date: |
Thu, 10 Oct 2019 13:36:16 +0100 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Thu, Oct 10, 2019 at 01:21:54PM +0100, Stefan Hajnoczi wrote:
> The following statement produces a SyntaxWarning with Python 3.8:
>
> if len(format) is 0:
> scripts/tracetool/__init__.py:459: SyntaxWarning: "is" with a literal. Did
> you mean "=="?
>
> Use the conventional len(x) == 0 syntax instead.
>
> Reported-by: Daniel P. Berrangé <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> scripts/tracetool/__init__.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <address@hidden>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|