compilation errors like <command-line>:0:9: error: unable to find numeric literal operator 'operator""a5850f' because the git revision macro was not properly escaped
The subprocess module returns bytes. In python3 the script would print -DGIT_REV=b'a5850f' because it is not properly decoded. The new code works in python2 and python3.
This fixes two problems with the example code:
<command-line>:0:9: error: unable to find numeric literal operator 'operator""a5850f'
because the git revision macro was not properly escaped-DGIT_REV=b'a5850f'
because it is not properly decoded. The new code works in python2 and python3.