mitogen icon indicating copy to clipboard operation
mitogen copied to clipboard

mitogen.parent.Connection._first_stage() does not import platform

Open moreati opened this issue 4 years ago • 2 comments

In the first stage there is a workaround for certain MacOS versions. However it uses platform.release(), without any corresponding import in the output ofget_boot_command(). I believe this would cause an error, with a matching MacOS target.

https://github.com/dw/mitogen/blob/cc8f9a016965876bcd9ec390d53035d6ed842b07/mitogen/parent.py#L1438-L1442 Is this workaround still needed? If so we could probably use os.uname() instead of platform.release().

moreati avatar Jan 16 '21 15:01 moreati

sys.version[:3] will fail on Python 3.10

moreati avatar Jan 16 '21 20:01 moreati

Some experimentation to reduce _first_stage(), so far saved 200ish bytes https://github.com/dw/mitogen/compare/master...moreati:first-stage-golf

moreati avatar Jan 16 '21 21:01 moreati