summaryrefslogtreecommitdiff
path: root/tests/configs/simple-timing-mp-ruby.py
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2017-07-31 11:19:41 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-08-30 16:25:44 +0000
commit47557157d84d2821accf81ff6d72041635ccd050 (patch)
treeba594fd76e342861f5af40d032c16a8ef6a83819 /tests/configs/simple-timing-mp-ruby.py
parent9f465d0a1b35a37a1c5d3489de0f78f314a662d1 (diff)
downloadgem5-47557157d84d2821accf81ff6d72041635ccd050.tar.xz
python: Make GlobalExitEvent.getCode() return an int
PyBind normally casts integers returned from the C to long in Python. This is normally fine since long in most cases behaves just like an int. However, when passing the return value from getcode() to sys.exit, unexpected behavior ensues. Due to the way the function is defined, any type other than int (with the exception of None) will be treated as an error and be equivalent to sys.exit(1). Since we frequently use the sys.exit(event.getCode()) pattern, we need to ensure that the function returns an integer. This change adds an explicit type conversion to a Python integer in the wrapper code. Change-Id: I73d6b881025064afa2b2e6eb4512fa2a4b0a87da Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jose Marinho <jose.marinho@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-on: https://gem5-review.googlesource.com/4280 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Joe Gross <joe.gross@amd.com>
Diffstat (limited to 'tests/configs/simple-timing-mp-ruby.py')
0 files changed, 0 insertions, 0 deletions