1
- # Copyright (c) IBM Corporation 2020, 2023
1
+ # Copyright (c) IBM Corporation 2020, 2024
2
2
# Licensed under the Apache License, Version 2.0 (the "License");
3
3
# you may not use this file except in compliance with the License.
4
4
# You may obtain a copy of the License at
34
34
35
35
36
36
def is_posix ():
37
- """ Determine if the system is POSIX certified or compliant
37
+ """Determine if the system is POSIX certified or compliant.
38
38
39
- Returns:
40
- bool -- Whether the system is POSIX
39
+ Returns
40
+ -------
41
+ bool
42
+ Whether the system is POSIX.
41
43
"""
42
44
return OS_NAME == "posix"
43
45
44
46
45
47
def is_nix ():
46
- """ Determine if the system is a variant of Unix, supported by Python.
48
+ """Determine if the system is a variant of Unix, supported by Python.
47
49
48
- Returns:
49
- bool -- Whether the system is Unix-based
50
+ Returns
51
+ -------
52
+ bool
53
+ Whether the system is Unix-based.
50
54
"""
51
55
if not is_posix ():
52
56
return False
@@ -58,19 +62,23 @@ def is_nix():
58
62
59
63
60
64
def is_win ():
61
- """ Determine if the system is a Windows platform
65
+ """Determine if the system is a Windows platform.
62
66
63
- Returns:
64
- bool -- Whether the system is Windows
67
+ Returns
68
+ -------
69
+ bool
70
+ Whether the system is Windows.
65
71
"""
66
72
return "win32" in platform ().lower () or OS_NAME == "nt"
67
73
68
74
69
75
def is_zos ():
70
- """ Determine if the system is a z/OS distribution
76
+ """Determine if the system is a z/OS distribution.
71
77
72
- Returns:
73
- bool -- Whether the system is z/OS
78
+ Returns
79
+ -------
80
+ bool
81
+ Whether the system is z/OS.
74
82
"""
75
83
is_zos_unix = is_posix () and not is_nix ()
76
84
return is_zos_unix and SYS_PLATFORM == "zos"
0 commit comments