From 62b0ce6d9d0cc03279228baa709ffca9eddaae35 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 2 Jun 2020 14:10:49 +0000 Subject: [PATCH] Don't use "is" with a literal to test for equality Solve a SyntaxWarning under Python 3.8 and later for use of the "is" identity operator when comparing literals, by replacing with the "==" equality operator. --- weather.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weather.py b/weather.py index 71cf0ec..ee25089 100644 --- a/weather.py +++ b/weather.py @@ -1105,7 +1105,7 @@ def guess( print( " (proximity %s, %.3gkm, %.3gmi)" % ( score, km, mi ) ) - elif searchtype is "coordinates": + elif searchtype == "coordinates": print( " (%.3gkm, %.3gmi)" % (km, mi) ) if zone[0]: print( @@ -1121,7 +1121,7 @@ def guess( print( " (proximity %s, %.3gkm, %.3gmi)" % ( score, km, mi ) ) - elif searchtype is "coordinates" and zone[0]: + elif searchtype == "coordinates" and zone[0]: print( " (%.3gkm, %.3gmi)" % (km, mi) ) if cache_search: now = time.time() -- 2.11.0