bpo-35346, platform: replace os.popen() with subprocess by vstinner · Pull Request #10786 · python/cpython
-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Conversation
Replace os.popen() with subprocess.check_output() in the platform module: * platform.uname() (_syscmd_ver() helper function) now redirects stderr to DEVNULL; * Remove platform.DEV_NULL; * _syscmd_uname() and _syscmd_file() no longer catch AttributeError. The "except AttributeError:" was only needed in Python 2, when os.popen() was not always available. In Python 3, subprocess.check_output() is always available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters