◐ Shell
clean mode source ↗

bpo-8110: Refactor platform detection in subprocess by zware · Pull Request #9053 · python/cpython

Conversation

Check for functionality via imports rather than checking sys.platform
specifically for Windows

vstinner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

pppery

try:
import msvcrt
import _winapi
_mswindows = True

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be in the "else" block?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _mswindows = True? sure, it could be. But it doesn't matter.

gpshead

@zware zware mentioned this pull request

Jan 17, 2022