summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel J. Smith <njs@pobox.com>2016-02-16 02:55:01 +0000
committerNathaniel J. Smith <njs@pobox.com>2016-02-16 02:55:01 +0000
commit0de123452d6c25a8708ba1e3d921ab7dbd772516 (patch)
tree33306fdd7dc11a48488f9ee2e620020c9a5c034d
parent2f8068c5d566d4e0566018fbbdd41d1f6901000b (diff)
parentc854818b60d904e2dbaa48710490441a63d0f836 (diff)
downloadnumpy-0de123452d6c25a8708ba1e3d921ab7dbd772516.tar.gz
Merge pull request #7256 from dongjoon-hyun/replace_is_none
MAINT: Use `is None` or `is not None` instead of `== None` or `!= None`.
-rw-r--r--numpy/core/code_generators/generate_umath.py2
-rw-r--r--numpy/tests/test_scripts.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py
index b3d8f43ae..a96437a42 100644
--- a/numpy/core/code_generators/generate_umath.py
+++ b/numpy/core/code_generators/generate_umath.py
@@ -975,7 +975,7 @@ r"""f = PyUFunc_FromFuncAndData(%s_functions, %s_data, %s_signatures, %d,
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 1c108ddb1..bd7d06c95 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(