summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaglis <827324+naglis@users.noreply.github.com>2023-03-28 20:12:02 +0300
committerGitHub <noreply@github.com>2023-03-28 19:12:02 +0200
commit3ce642918d1fb443b3b484e5418215c9f9b8796c (patch)
tree498d365079009e3ead76bcda9a10ecc2c6fe26f3
parent6040833ae1dd41b96ab5b226debffa8c47b66569 (diff)
downloadurwid-3ce642918d1fb443b3b484e5418215c9f9b8796c.tar.gz
Use == instead of "is" for equality testing (#431)
Identity check (`is`, `is not`) with certain literals (e.g. strings, numbers) is not guaranteed by the language specification to work and issue a warning starting with Python 3.8, e.g.: > examples/browse.py:326: SyntaxWarning: "is" with a literal. Did you mean "=="?
-rwxr-xr-xexamples/browse.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/browse.py b/examples/browse.py
index 6c0eb37..39ac27a 100755
--- a/examples/browse.py
+++ b/examples/browse.py
@@ -323,7 +323,7 @@ def store_initial_cwd(name):
def starts_expanded(name):
"""Return True if directory is a parent of initial cwd."""
- if name is '/':
+ if name == '/':
return True
l = name.split(dir_sep())