diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-09-04 01:13:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-04 01:13:00 (GMT) |
commit | e2b29304137e6253b7bb89c180ef5d113d60b4eb (patch) | |
tree | 3164873032e2529360dc8b71a897c35c7f0309a3 /Lib/test | |
parent | 2a8956c268772fd31aeeb6ee522f123af94a2926 (diff) | |
download | cpython-e2b29304137e6253b7bb89c180ef5d113d60b4eb.zip cpython-e2b29304137e6253b7bb89c180ef5d113d60b4eb.tar.gz cpython-e2b29304137e6253b7bb89c180ef5d113d60b4eb.tar.bz2 |
[3.10] bpo-45060: Get rid of few uses of the equality operators with None (GH-28087). (GH-28092)
(cherry picked from commit 3c65457156d87e55010507d616b4eecb7a02883d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/datetimetester.py | 2 | ||||
-rw-r--r-- | Lib/test/test_pty.py | 2 | ||||
-rw-r--r-- | Lib/test/test_type_annotations.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 316cf0b..6414f1a 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -344,7 +344,7 @@ class TestTimeZone(unittest.TestCase): with self.assertRaises(TypeError): timezone(ZERO) < timezone(ZERO) self.assertIn(timezone(ZERO), {timezone(ZERO)}) self.assertTrue(timezone(ZERO) != None) - self.assertFalse(timezone(ZERO) == None) + self.assertFalse(timezone(ZERO) == None) tz = timezone(ZERO) self.assertTrue(tz == ALWAYS_EQ) diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index e2e9475..0c17812 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -136,7 +136,7 @@ class PtyTest(unittest.TestCase): mode = None new_stdin_winsz = None - if self.stdin_rows != None and self.stdin_cols != None: + if self.stdin_rows is not None and self.stdin_cols is not None: try: # Modify pty.STDIN_FILENO window size; we need to # check if pty.openpty() is able to set pty slave diff --git a/Lib/test/test_type_annotations.py b/Lib/test/test_type_annotations.py index f6c99bd..87f46c2c 100644 --- a/Lib/test/test_type_annotations.py +++ b/Lib/test/test_type_annotations.py @@ -71,7 +71,7 @@ class TypeAnnotationTests(unittest.TestCase): @__annotations__.deleter def __annotations__(self): - if hasattr(self, 'my_annotations') and self.my_annotations == None: + if getattr(self, 'my_annotations', False) is None: raise AttributeError('__annotations__') self.my_annotations = None |