From 70d44fcf5c913e9d1f5a2c4d33c906e2a8a9935d Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Tue, 21 Mar 2023 11:44:05 +0800 Subject: [PATCH] Login.py: fix SyntaxWrning: 'is not' with a literal. --- app/Login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Login.py b/app/Login.py index f914359..48dffc5 100644 --- a/app/Login.py +++ b/app/Login.py @@ -96,7 +96,7 @@ class UserName: if ' ' in self.username: # a user name must not include a whitespace return 'Whitespace is not allowed in the user name.' for c in self.username: # a user name must not include special characters, except non-leading periods or underscores - if c in string.punctuation and c is not '.' and c is not '_': + if c in string.punctuation and c != '.' and c != '_': return f'{c} is not allowed in the user name.' if self.username in ['signup', 'login', 'logout', 'reset', 'mark', 'back', 'unfamiliar', 'familiar', 'del', "admin"]: return 'You used a restricted word as your user name. Please come up with a better one.'