summarylogtreecommitdiffstats
path: root/scons-4.2.x.patch
blob: 61e635044d153a32b3de240027ca3f8e0c654982 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From bdfaeaa09501f520953372e4d6043c9dad533c79 Mon Sep 17 00:00:00 2001
From: Petteri Aimonen <jpa@git.mail.kapsi.fi>
Date: Mon, 2 Aug 2021 17:28:45 +0300
Subject: [PATCH] Fix problems running tests with newer SCons version
 (deprecated env.has_key())

---
 tests/fuzztest/SConscript             | 6 +++---
 tests/site_scons/site_init.py         | 6 +++---
 tests/site_scons/site_tools/nanopb.py | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/fuzztest/SConscript b/tests/fuzztest/SConscript
index 7c0d6e2..a5df905 100644
--- a/tests/fuzztest/SConscript
+++ b/tests/fuzztest/SConscript
@@ -80,12 +80,12 @@ def run_against_corpus(target, source, env):
     count = 0
     args = [str(source[0])]
 
-    if env.has_key("TEST_RUNNER"):
+    if "TEST_RUNNER" in env:
         args = [env["TEST_RUNNER"]] + args
 
-    if env.has_key("FUZZTEST_CORPUS_SAMPLESIZE"):
+    if "FUZZTEST_CORPUS_SAMPLESIZE" in env:
         samplesize = int(env["FUZZTEST_CORPUS_SAMPLESIZE"])
-    elif env.has_key("EMBEDDED"):
+    elif env.get('EMBEDDED'):
         samplesize = 100
     else:
         samplesize = 4096
diff --git a/tests/site_scons/site_init.py b/tests/site_scons/site_init.py
index ce8f7e1..676b0fb 100644
--- a/tests/site_scons/site_init.py
+++ b/tests/site_scons/site_init.py
@@ -32,15 +32,15 @@ def add_nanopb_builders(env):
         else:
             infile = None
         
-        if env.has_key("COMMAND"):
+        if "COMMAND" in env:
             args = [env["COMMAND"]]
         else:
             args = [str(source[0])]
         
-        if env.has_key('ARGS'):
+        if 'ARGS' in env:
             args.extend(env['ARGS'])
 
-        if env.has_key("TEST_RUNNER"):
+        if "TEST_RUNNER" in env:
             args = [env["TEST_RUNNER"]] + args
         
         print('Command line: ' + str(args))
diff --git a/tests/site_scons/site_tools/nanopb.py b/tests/site_scons/site_tools/nanopb.py
index 1a25808..37b8e20 100644
--- a/tests/site_scons/site_tools/nanopb.py
+++ b/tests/site_scons/site_tools/nanopb.py
@@ -46,7 +46,7 @@ SCons.Warnings.enableWarningClass(NanopbWarning)
 
 def _detect_nanopb(env):
     '''Find the path to nanopb root directory.'''
-    if env.has_key('NANOPB'):
+    if 'NANOPB' in env:
         # Use nanopb dir given by user
         return env['NANOPB']
 
@@ -60,7 +60,7 @@ def _detect_nanopb(env):
 
 def _detect_python(env):
     '''Find Python executable to use.'''
-    if env.has_key('PYTHON'):
+    if 'PYTHON' in env:
         return env['PYTHON']
 
     p = env.WhereIs('python3')
@@ -85,7 +85,7 @@ def _detect_nanopb_generator(env):
 
 def _detect_protoc(env):
     '''Find the path to the protoc compiler.'''
-    if env.has_key('PROTOC'):
+    if 'PROTOC' in env:
         # Use protoc defined by user
         return env['PROTOC']
 
@@ -113,7 +113,7 @@ def _detect_protoc(env):
 
 def _detect_protocflags(env):
     '''Find the options to use for protoc.'''
-    if env.has_key('PROTOCFLAGS'):
+    if 'PROTOCFLAGS' in env:
         return env['PROTOCFLAGS']
 
     p = _detect_protoc(env)
-- 
2.32.0