summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-06-24 03:23:23 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-06-24 03:23:23 (GMT)
commit756ad7b12c04236a6481d1823cea38a345fd73d3 (patch)
tree92dc4467a7084ee46cb52b5d57b29f34b9114c16 /src/engine/SCons
parent05e90800d7925074331b44794093894349e14449 (diff)
downloadSCons-756ad7b12c04236a6481d1823cea38a345fd73d3.zip
SCons-756ad7b12c04236a6481d1823cea38a345fd73d3.tar.gz
SCons-756ad7b12c04236a6481d1823cea38a345fd73d3.tar.bz2
py2/3 fix signatures for py2. Note this means that many builds may unneccesarily rebuild on upgrade to 3.0.0 as the signature will have changed for python actions
Diffstat (limited to 'src/engine/SCons')
-rw-r--r--src/engine/SCons/ActionTests.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py
index 82c5e0e..6751091 100644
--- a/src/engine/SCons/ActionTests.py
+++ b/src/engine/SCons/ActionTests.py
@@ -2055,7 +2055,12 @@ class ObjectContentsTestCase(unittest.TestCase):
# See definition above
o = TestClass()
c = SCons.Action._object_contents(o)
- expected = bytearray("(i__main__\nTestClass\np1\n(dp2\nS'a'\nS'a'\nsS'b'\nS'b'\nsb.", 'utf-8')
+
+ if TestCmd.PY3:
+ expected = bytearray(r'ccopy_reg\n_reconstructor\nq\x00(c__main__\nTestClass\nq\x01c__builtin__\nobject\nq\x02Ntq\x03Rq\x04}q\x05(X\x01\x00\x00\x00bq\x06h\x06X\x01\x00\x00\x00aq\x07h\x07ub.','utf-8')
+ else:
+ expected = bytearray(b'(c__main__\nTestClass\nq\x01oq\x02}q\x03(U\x01aU\x01aU\x01bU\x01bub.')
+
assert expected == c, "Got\n" + repr(c) + "\nExpected\n" + repr(expected)
# @unittest.skip("Results vary between py2 and py3, not sure if test makes sense to implement")
@@ -2064,7 +2069,10 @@ class ObjectContentsTestCase(unittest.TestCase):
code = compile("print('Hello, World!')", '<string>', 'exec')
c = SCons.Action._code_contents(code)
- expected = bytearray("0, 0, 0, 0,(N.),(),(d\x00\x00GHd\x01\x00S)", 'utf-8')
+ if TestCmd.PY3:
+ expected = bytearray(b'0, 0, 0, 0,(N.),(X\x05\x00\x00\x00printq\x00.),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)','utf-8')
+ else:
+ expected = bytearray(b"0, 0, 0, 0,(N.),(),(d\x00\x00GHd\x01\x00S)")
assert expected == c, "Got\n" + repr(c) + "\nExpected\n" + repr(expected)