diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py index b3d8f43ae00b..a96437a4205e 100644 --- a/numpy/core/code_generators/generate_umath.py +++ b/numpy/core/code_generators/generate_umath.py @@ -975,7 +975,7 @@ def make_ufuncs(funcdict): uf.nin, uf.nout, uf.identity, name, docstring)) - if uf.typereso != None: + if uf.typereso is not None: mlist.append( r"((PyUFuncObject *)f)->type_resolver = &%s;" % uf.typereso) mlist.append(r"""PyDict_SetItemString(dictionary, "%s", f);""" % name) diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py index 1c108ddb1a36..bd7d06c954a7 100644 --- a/numpy/tests/test_scripts.py +++ b/numpy/tests/test_scripts.py @@ -49,7 +49,7 @@ def run_command(cmd, check_code=True): cmd = ['"{0}"'.format(c) if ' ' in c else c for c in cmd] proc = Popen(cmd, stdout=PIPE, stderr=PIPE) stdout, stderr = proc.communicate() - if proc.poll() == None: + if proc.poll() is None: proc.terminate() if check_code and proc.returncode != 0: raise RuntimeError('\n'.join(