diff options
author | Mats Wichmann <mats@linux.com> | 2020-10-11 13:02:52 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2020-10-13 13:20:22 (GMT) |
commit | 394faec5f14c2a933f172ce13935f3f2ad2b7101 (patch) | |
tree | 581714012738cae5812059fc4ea2bc5395e8a8f7 /SCons/UtilTests.py | |
parent | 7a32c410874537c5e7b4dc2a76801b4e33f4e120 (diff) | |
download | SCons-394faec5f14c2a933f172ce13935f3f2ad2b7101.zip SCons-394faec5f14c2a933f172ce13935f3f2ad2b7101.tar.gz SCons-394faec5f14c2a933f172ce13935f3f2ad2b7101.tar.bz2 |
Drop some more Py2 compat things
Change exception type in a a couple of try block to what could
go wrong, Py3 would not raise UniCodeDecodeError for these cases
One try-import of StringIO module
sconsign does not need a decode that was claimed as compat hack
Remove some sys.version_info checks
Use more modern way to get Python details in test frawmework
AddMethod updated and RenameFunction dropped - it had become a one-liner
and had no clients other than AddMethod (never exposed as public)
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/UtilTests.py')
-rw-r--r-- | SCons/UtilTests.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/SCons/UtilTests.py b/SCons/UtilTests.py index 50c7ed3..72bbaf3 100644 --- a/SCons/UtilTests.py +++ b/SCons/UtilTests.py @@ -193,11 +193,7 @@ class UtilTestCase(unittest.TestCase): try: node, expect, withtags = self.tree_case_1() - if sys.version_info.major < 3: - IOStream = io.BytesIO - else: - IOStream = io.StringIO - + IOStream = io.StringIO sys.stdout = IOStream() print_tree(node, get_children) actual = sys.stdout.getvalue() @@ -249,11 +245,6 @@ class UtilTestCase(unittest.TestCase): def test_is_Dict(self): assert is_Dict({}) assert is_Dict(UserDict()) - - # os.environ is not a dictionary in python 3 - if sys.version_info < (3, 0): - assert is_Dict(os.environ) - try: class mydict(dict): pass |