Try to fix testcase build error on new SCons

Related to this commit:
https://github.com/SCons/scons/commit/b71dbb402a8e1235564a8127853ba80f688eb073
diff --git a/tests/site_scons/site_tools/nanopb.py b/tests/site_scons/site_tools/nanopb.py
index de30b3e..c82d11a 100644
--- a/tests/site_scons/site_tools/nanopb.py
+++ b/tests/site_scons/site_tools/nanopb.py
@@ -35,7 +35,12 @@
 import os.path
 import platform
 
-class NanopbWarning(SCons.Warnings.Warning):
+try:
+    warningbase = SCons.Warnings.SconsWarning
+except AttributeError:
+    warningbase = SCons.Warnings.Warning
+
+class NanopbWarning(warningbase):
     pass
 SCons.Warnings.enableWarningClass(NanopbWarning)