From 17de842ce3b849b3b230b56a02c0aa0acce3187d Mon Sep 17 00:00:00 2001 From: AZero13 Date: Thu, 11 Dec 2025 09:35:33 -0500 Subject: [PATCH] PEP compliance: use is not --- Lib/dataclasses.py | 2 +- Lib/wsgiref/validate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index 730ced7299865e..847f3223f7bf0d 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -527,7 +527,7 @@ def add_fns_to_class(self, cls): if already_exists and (msg_extra := self.overwrite_errors.get(name)): error_msg = (f'Cannot overwrite attribute {fn.__name__} ' f'in class {cls.__name__}') - if not msg_extra is True: + if msg_extra is not True: error_msg = f'{error_msg} {msg_extra}' raise TypeError(error_msg) diff --git a/Lib/wsgiref/validate.py b/Lib/wsgiref/validate.py index 1a1853cd63a0d2..a9ee8634db1faf 100644 --- a/Lib/wsgiref/validate.py +++ b/Lib/wsgiref/validate.py @@ -179,7 +179,7 @@ def start_response_wrapper(*args, **kw): environ['wsgi.errors'] = ErrorWrapper(environ['wsgi.errors']) iterator = application(environ, start_response_wrapper) - assert_(iterator is not None and iterator != False, + assert_(iterator is not None and iterator is not False, "The application must return an iterator, if only an empty list") check_iterator(iterator)