`if PY3 and  isinstance(jobtype.code, bytes):`

`bytes` in Python 2 exists but it's exactly the same object as `str` which means the decoding step is not strictly necessary.