Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/dbm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ supported.
contains them all::

k = db.firstkey()
while k != None:
while k is not None:
print(k)
k = db.nextkey(k)

Expand Down
4 changes: 2 additions & 2 deletions Lib/ctypes/_aix.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def find_shared(paths, name):
if path.exists(archive):
members = get_shared(get_ld_headers(archive))
member = get_member(re.escape(name), members)
if member != None:
if member is not None:
return (base, member)
else:
return (None, None)
Expand All @@ -307,7 +307,7 @@ def find_library(name):

libpaths = get_libpaths()
(base, member) = find_shared(libpaths, name)
if base != None:
if base is not None:
return f"{base}({member})"

# To get here, a member in an archive has not been found
Expand Down
2 changes: 1 addition & 1 deletion Lib/email/contentmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _encode_text(string, charset, cte, policy):
linesep = policy.linesep.encode('ascii')
def embedded_body(lines): return linesep.join(lines) + linesep
def normal_body(lines): return b'\n'.join(lines) + b'\n'
if cte==None:
if cte is None:
# Use heuristics to decide on the "best" encoding.
if max((len(x) for x in lines), default=0) <= policy.max_line_length:
try:
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/datetimetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def test_comparison(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_pty.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_openpty(self):
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
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_type_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __annotations__(self, value):

@__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

Expand Down
4 changes: 2 additions & 2 deletions Modules/_gdbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,15 +450,15 @@ The following code prints every key in the database db, without having
to create a list in memory that contains them all:

k = db.firstkey()
while k != None:
while k is not None:
print(k)
k = db.nextkey(k)
[clinic start generated code]*/

static PyObject *
_gdbm_gdbm_nextkey_impl(gdbmobject *self, PyTypeObject *cls, const char *key,
Py_ssize_clean_t key_length)
/*[clinic end generated code: output=204964441fdbaf02 input=fcf6a51a96ce0172]*/
/*[clinic end generated code: output=204964441fdbaf02 input=365e297bc0b3db48]*/
{
PyObject *v;
datum dbm_key, nextkey;
Expand Down
4 changes: 2 additions & 2 deletions Modules/clinic/_gdbmmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ def print_block(self, block):
dsl_name = block.dsl_name
write = self.f.write

assert not ((dsl_name == None) ^ (output == None)), "you must specify dsl_name and output together, dsl_name " + repr(dsl_name)
assert not ((dsl_name is None) ^ (output is None)), "you must specify dsl_name and output together, dsl_name " + repr(dsl_name)

if not dsl_name:
write(input)
Expand Down Expand Up @@ -2931,7 +2931,7 @@ def converter_init(self, *, accept={int}, type=None):
self.format_unit = 'C'
elif accept != {int}:
fail("int_converter: illegal 'accept' argument " + repr(accept))
if type != None:
if type is not None:
self.type = type

def parse_arg(self, argname, displayname):
Expand Down