summaryrefslogtreecommitdiffstats
path: root/SCons/Tool/lex.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2021-05-05 14:37:22 (GMT)
committerMats Wichmann <mats@linux.com>2021-05-05 17:33:26 (GMT)
commitd7b1df36e2faf84c2b1789658300ceef90605997 (patch)
tree19d526d9ba9a771f305578f852fa2e6d01894f59 /SCons/Tool/lex.py
parentf046cf47ded412a0b96edb560ed7bb2daf72ccfb (diff)
downloadSCons-d7b1df36e2faf84c2b1789658300ceef90605997.zip
SCons-d7b1df36e2faf84c2b1789658300ceef90605997.tar.gz
SCons-d7b1df36e2faf84c2b1789658300ceef90605997.tar.bz2
Fix some imports and other checker warnings
* Removed a number of imports reported as unused. * Reorganize imports in a few places. * Checker reported warnings problems ("Instantiating an exception, but not raising it, has no effect"): serveral tool modules instantiated a warning class thinking (?) it would issue the warning; changed these to the standard use - calling the warn() function with the warnclass as an arg. * Tool modules that were touched had the copyright header munging applied. * Removed irritating "####" lines from gettext and msgfmt tools. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Tool/lex.py')
-rw-r--r--SCons/Tool/lex.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/SCons/Tool/lex.py b/SCons/Tool/lex.py
index a9f7a8a..d8d8de4 100644
--- a/SCons/Tool/lex.py
+++ b/SCons/Tool/lex.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.lex
-
-Tool-specific initialization for lex.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,9 +20,13 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for lex.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import os.path
import sys
@@ -39,6 +34,7 @@ import sys
import SCons.Action
import SCons.Tool
import SCons.Util
+import SCons.Warnings
from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
from SCons.Platform.win32 import CHOCO_DEFAULT_PATH
@@ -93,7 +89,11 @@ def get_lex_path(env, append_paths=False):
if append_paths:
env.AppendENVPath('PATH', os.path.dirname(bin_path))
return bin_path
- SCons.Warnings.SConsWarning('lex tool requested, but lex or flex binary not found in ENV PATH')
+
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ 'lex tool requested, but lex or flex binary not found in ENV PATH'
+ )
def generate(env):