The current code uses functions and features only found in newer versions of Python, so rework to allow use on systems only supporting older Python. Tested on Python 3.8 (released Oct 2019), but should work on 3.7 also. Suggested-by: Chen Minqiang <ptpt52@gmail.com> Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>