I use os.system to run a make command
os.system('make -C mydir/project all')
I'd like to see if make fails or not. The system documentation states that the return code is in the same format as wait()
Wait for completion of a child process, and return a tuple containing its pid
and exit status indication: a 16-bit number, whose low byte is the signal number
that killed the process, and whose high byte is the exit status (if the signal
number is zero); the high bit of the low byte is set if a core file was produced.
so if make (or another application) returns -1, I have to convert 0xFFxx (I don't really care about the pid of the called) to -1. After a right shift, I get 0xFF, but I cannot get it to convert that to -1, it always print 255.
So, in python, how can I convert 255 to -1, or how can I tell the interpreter that my 255 is in fact a 8 bits signed integer?