diff options
author | Mats Wichmann <mats@linux.com> | 2024-10-19 14:24:33 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2024-10-19 14:25:22 (GMT) |
commit | fb8932b837a2fe63dd5370e5b05a26f930db6f50 (patch) | |
tree | d7f2bd8f57f310d6dfe394d75aa5bb7955ed5bab /SCons | |
parent | c25c7b1d727f0da3288fa6c3cad6646e708d11e3 (diff) | |
download | SCons-fb8932b837a2fe63dd5370e5b05a26f930db6f50.zip SCons-fb8932b837a2fe63dd5370e5b05a26f930db6f50.tar.gz SCons-fb8932b837a2fe63dd5370e5b05a26f930db6f50.tar.bz2 |
Move IS_ROOT definition to framework
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons')
-rw-r--r-- | SCons/CacheDirTests.py | 8 | ||||
-rw-r--r-- | SCons/Node/FSTests.py | 8 | ||||
-rw-r--r-- | SCons/Variables/PathVariableTests.py | 8 |
3 files changed, 3 insertions, 21 deletions
diff --git a/SCons/CacheDirTests.py b/SCons/CacheDirTests.py index 7b6c5aa..3fbab4e 100644 --- a/SCons/CacheDirTests.py +++ b/SCons/CacheDirTests.py @@ -28,18 +28,12 @@ import unittest import tempfile import stat -from TestCmd import TestCmd, IS_WINDOWS +from TestCmd import TestCmd, IS_WINDOWS, IS_ROOT import SCons.CacheDir built_it = None -try: - IS_ROOT = os.geteuid() == 0 -except AttributeError: - IS_ROOT = False - - class Action: def __call__(self, targets, sources, env, **kw) -> int: global built_it diff --git a/SCons/Node/FSTests.py b/SCons/Node/FSTests.py index 14a2b56..83ceef2 100644 --- a/SCons/Node/FSTests.py +++ b/SCons/Node/FSTests.py @@ -31,7 +31,7 @@ import shutil import stat from typing import Optional -from TestCmd import TestCmd, IS_WINDOWS +from TestCmd import TestCmd, IS_WINDOWS, IS_ROOT import SCons.Errors import SCons.Node.FS @@ -44,12 +44,6 @@ built_it = None scanner_count = 0 -try: - IS_ROOT = os.geteuid() == 0 -except AttributeError: - IS_ROOT = False - - class Scanner: def __init__(self, node=None) -> None: global scanner_count diff --git a/SCons/Variables/PathVariableTests.py b/SCons/Variables/PathVariableTests.py index 87d6bdf..b093053 100644 --- a/SCons/Variables/PathVariableTests.py +++ b/SCons/Variables/PathVariableTests.py @@ -28,13 +28,7 @@ import SCons.Errors import SCons.Variables import TestCmd -from TestCmd import IS_WINDOWS - -try: - IS_ROOT = os.geteuid() == 0 -except AttributeError: - IS_ROOT = False - +from TestCmd import IS_WINDOWS, IS_ROOT class PathVariableTestCase(unittest.TestCase): def test_PathVariable(self) -> None: |