Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Malcolm Smith <[email protected]>
  • Loading branch information
freakboy3742 and mhsmith authored Mar 24, 2024
1 parent 84ba760 commit 4194849
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -785,9 +785,9 @@ process and user.
``socket.gethostbyaddr(socket.gethostname())``.

On macOS, iOS and Android, this returns the *kernel* name and version (i.e.,
``'Darwin'`` on macOS and iOS; ``'Linux'`` on Android), not the user-facing
operating system name. :func:`platform.uname()` can be used to get the
user-facing operating system name on iOS and Android.
``'Darwin'`` on macOS and iOS; ``'Linux'`` on Android). :func:`platform.uname()`
can be used to get the user-facing operating system name and version on iOS and
Android.

.. availability:: Unix.

Expand Down
9 changes: 5 additions & 4 deletions Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ Cross Platform
Returns the system/OS name, such as ``'Linux'``, ``'Darwin'``, ``'Java'``,
``'Windows'``. An empty string is returned if the value cannot be determined.

On iOS, this returns the OS name (i.e, ``'iOS``` or ``'iPadOS'``), rather than
the kernel name (``'Darwin'``).
On iOS and Android, this returns the user-facing OS name (i.e, ``'iOS``,
``'iPadOS'`` or ``'Android'``). To obtain the kernel name (``'Darwin'`` or
``'Linux'``), use :func:`os.uname()`.

.. function:: system_alias(system, release, version)

Expand All @@ -163,8 +164,8 @@ Cross Platform
Returns the system's release version, e.g. ``'#3 on degas'``. An empty string is
returned if the value cannot be determined.

On iOS, this is the iOS version, not the Darwin kernel version. To obtain
the Darwin kernel version, use :func:`os.uname()`.
On iOS and Android, this is the user-facing OS version. To obtain the
Darwin or Linux kernel version, use :func:`os.uname()`.

.. function:: uname()

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_uname(self):

if sys.platform == "ios":
self.assertIn(res.system, {"iOS", "iPadOS"})
self.assertIn(res.release, platform.ios_ver().release)
self.assertEqual(res.release, platform.ios_ver().release)

@unittest.skipUnless(sys.platform.startswith('win'), "windows only test")
def test_uname_win32_without_wmi(self):
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def test_platform_in_subprocess(self):

@unittest.skipIf(is_wasi, "Incompatible with WASI mapdir and OOT builds")
@unittest.skipIf(is_apple_mobile,
f"{sys.platform} doesn't distribute config.h in the runtime environment")
f"{sys.platform} doesn't include config folder at runtime")
def test_srcdir(self):
# See Issues #15322, #15364.
srcdir = sysconfig.get_config_var('srcdir')
Expand Down Expand Up @@ -567,7 +567,7 @@ class MakefileTests(unittest.TestCase):
'Test is not Windows compatible')
@unittest.skipIf(is_wasi, "Incompatible with WASI mapdir and OOT builds")
@unittest.skipIf(is_apple_mobile,
f"{sys.platform} doesn't distribute config.h in the runtime environment")
f"{sys.platform} doesn't include config folder at runtime")
def test_get_makefile_filename(self):
makefile = sysconfig.get_makefile_filename()
self.assertTrue(os.path.isfile(makefile), makefile)
Expand Down

0 comments on commit 4194849

Please sign in to comment.