Update magma.py to check for Linux platform in Py3-compatible manner.