diff --git a/Lib/platform.py b/Lib/platform.py index 279c96c771eddd..99f6a24b1ae959 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -500,7 +500,7 @@ def _syscmd_ver(system='', release='', version='', } def win32_is_iot(isIot=False): - if win32_editionId() == 'IoTUAP' or win32_editionId() == 'NanoServer' or win32_editionId() == 'WindowsCoreHeadless' or win32_editionId() == 'IoTEdgeOS': + if win32_editionId() in ('IoTUAP', 'NanoServer', 'WindowsCoreHeadless', 'IoTEdgeOS'): return True return False diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 6b4dae28132052..1c281cf900e050 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -93,7 +93,7 @@ def tearDown(self): mimetypes.types_map.clear() mimetypes.types_map.update(self.original_types_map) - @unittest.skipIf(win32_editionId() == 'NanoServer' or win32_editionId() == 'WindowsCoreHeadless' or win32_editionId() == 'IoTEdgeOS', "mime types registry keys not available on NanoServer") + @unittest.skipIf(win32_editionId() in ('NanoServer', 'WindowsCoreHeadless', 'IoTEdgeOS'), "mime types registry keys not available on NanoServer") def test_registry_parsing(self): # the original, minimum contents of the MIME database in the # Windows registry is undocumented AFAIK. diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index 78bc183c0b4a95..fcdd0b78577647 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -399,7 +399,7 @@ def test_named_arguments(self): DeleteKeyEx(key=HKEY_CURRENT_USER, sub_key=test_key_name, access=KEY_ALL_ACCESS, reserved=0) - @unittest.skipIf(win32_editionId() == 'WindowsCoreHeadless' or win32_editionId() == 'IoTEdgeOS', "APIs not available on WindowsCoreHeadless") + @unittest.skipIf(win32_editionId() in ('WindowsCoreHeadless', 'IoTEdgeOS'), "APIs not available on WindowsCoreHeadless") def test_reflection_functions(self): # Test that we can call the query, enable, and disable functions # on a key which isn't on the reflection list with no consequences.