testutils/platform: Refactor to be compatible with Python 3.9
Starting from Python 3.9, it seems like the _replace()
method no
longer works on platform.uname_result
objects, that are returned by
platform.uname()
. This causes some of our tests to fail on Python 3.9.
See https://bugs.python.org/issue42163 for upstream issue.
Fix it by slightly changing the way we override the values of the
platform.uname()
function, such that it works on both Python 3.9 and
3.8 (and below).
Update: I can now confirm that this is the only patch that we need to make our tests pass on 3.9.
Edited by Chandan Singh