# Since the python bytecode has per version differences, we need different expected results per version
func_matches = {
- (2,7) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00S),(),()'),
- (3,5) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00S),(),()'),
- (3,6) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00S\x00),(),()'),
+ (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
}
meth_matches = [
pass
func_matches = {
- (2,7) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00S),(),()'),
- (3,5) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00S),(),()'),
- (3,6) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00S\x00),(),()'),
+ (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
}
meth_matches = {
- (2,7) : bytearray(b'1, 1, 0, 0,(N.),(),(d\x00\x00S),(),()'),
- (3,5) : bytearray(b'1, 1, 0, 0,(N.),(),(d\x00\x00S),(),()'),
- (3,6) : bytearray(b'1, 1, 0, 0,(N.),(),(d\x00S\x00),(),()'),
+ (2,7) : bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,5) : bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,6) : bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'),
}
def factory(act, **kw):
func_matches = {
- (2,7) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00S),(),()'),
- (3,5) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00S),(),()'),
- (3,6) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00S\x00),(),()'),
+ (2,7) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,5) : bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'),
+ (3,6) : bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'),
}
meth_matches = [
# Since the python bytecode has per version differences, we need different expected results per version
expected = {
- (2,7) : bytearray(b'3, 3, 0, 0,(A test function),(),(|\x00\x00S),(),()'),
- (3,5) : bytearray(b'3, 3, 0, 0,(A test function),(),(|\x00\x00S),(),()'),
- (3,6) : bytearray(b'3, 3, 0, 0,(A test function),(),(|\x00S\x00),(),()'),
+ (2,7) : bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'),
+ (3,5) : bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'),
+ (3,6) : bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'),
}
c = SCons.Action._function_contents(func1)
# Since the python bytecode has per version differences, we need different expected results per version
expected = {
- (2,7): bytearray(b"{TestClass:__main__}[[[(<type \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<type \'object\'>,))]]]]{{1, 1, 0, 0,(N.,a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(N.),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}"),
- (3,5): bytearray(b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(N.,a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(N.),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}"),
- (3,6): bytearray(b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(N.,a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(N.),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}"),
+ (2,7): bytearray(b"{TestClass:__main__}[[[(<type \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<type \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}"),
+ (3,5): bytearray(b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01\x00|\x00\x00_\x00\x00d\x02\x00|\x00\x00_\x01\x00d\x00\x00S),(),(),2, 2, 0, 0,(),(),(d\x00\x00S),(),()}}{{{a=a,b=b}}}"),
+ (3,6): bytearray(b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}"),
}
assert c == expected[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+"\n"+repr(expected[sys.version_info[:2]])
# Since the python bytecode has per version differences, we need different expected results per version
expected = {
- (2,7) : bytearray(b'0, 0, 0, 0,(Hello, World!,N.),(),(d\x00\x00GHd\x01\x00S)'),
- (3,5) : bytearray(b'0, 0, 0, 0,(Hello, World!,N.),(print),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)'),
- (3,6) : bytearray(b'0, 0, 0, 0,(Hello, World!,N.),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'),
+ (2,7) : bytearray(b'0, 0, 0, 0,(N.),(),(d\x00\x00GHd\x01\x00S)'),
+ (3,5) : bytearray(b'0, 0, 0, 0,(N.),(print),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)'),
+ (3,6) : bytearray(b'0, 0, 0, 0,(N.),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'),
}
assert c == expected[sys.version_info[:2]], "Got\n"+repr(c)+"\nExpected \n"+"\n"+expected[sys.version_info[:2]]