From 36c17e2f514b8dcb94a5e12f78aa81391f5ca264 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 22 Dec 2020 08:44:04 -0800 Subject: [PATCH 1/3] tools: use `is None` consistently in Python We use `is None` instead of `== None` everywhere (which mostly just means test.py) except in one place in genv8constants.py. Switch to `is None` in genv8constants.py. This is slightly more efficient, although I can't imagine that makes a measurable difference here. PR-URL: https://github.com/nodejs/node/pull/36606 Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- tools/genv8constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/genv8constants.py b/tools/genv8constants.py index 8ab2ed8bae50c0..cb648d39ce7a18 100755 --- a/tools/genv8constants.py +++ b/tools/genv8constants.py @@ -95,7 +95,7 @@ def out_define(): curr_octet += 1 match = pattern.match(line) - if match == None: + if match is None: continue # Print previous symbol From 18fc50f983bbaa64b5c297dc31dae30ec98b5332 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 22 Dec 2020 09:02:56 -0800 Subject: [PATCH 2/3] tools: call close() explicitly in genv8constants.py PR-URL: https://github.com/nodejs/node/pull/36606 Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- tools/genv8constants.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/genv8constants.py b/tools/genv8constants.py index cb648d39ce7a18..64370ad29611c0 100755 --- a/tools/genv8constants.py +++ b/tools/genv8constants.py @@ -113,3 +113,5 @@ def out_define(): #endif /* V8_CONSTANTS_H */ """) + +outfile.close() From e068eec7834bd8e6b455d23949cec0c713860562 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 22 Dec 2020 09:03:46 -0800 Subject: [PATCH 3/3] tools: correct usage message for genv8constants.py PR-URL: https://github.com/nodejs/node/pull/36606 Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- tools/genv8constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/genv8constants.py b/tools/genv8constants.py index 64370ad29611c0..f750ca4de7523f 100755 --- a/tools/genv8constants.py +++ b/tools/genv8constants.py @@ -14,7 +14,7 @@ import errno if len(sys.argv) != 3: - print("usage: objsym.py outfile libv8_base.a") + print("Usage: genv8constants.py outfile libv8_base.a") sys.exit(2) outfile = open(sys.argv[1], 'w')