|
36 | 36 |
|
37 | 37 | # DEPRECATED attributes providing shortcuts to operating system checks based on os.name.
|
38 | 38 | #
|
39 |
| -# - is_win and is_posix are deprecated because it is clearer, and helps avoid bugs, to |
40 |
| -# write out the os.name checks explicitly. For example, is_win is False on Cygwin, but |
41 |
| -# is often assumed to be True. |
| 39 | +# These are deprecated because it is clearer, and helps avoid bugs, to write out the |
| 40 | +# os.name or sys.platform checks explicitly, especially in cases where it matters which |
| 41 | +# is used. For example, is_win is False on Cygwin, but is often assumed True. To detect |
| 42 | +# Cygwin, use sys.platform == "cygwin". (Also, in the past, is_darwin was unreliable.) |
42 | 43 | #
|
43 |
| -# - is_darwin is deprecated because it is always False on all systems, as os.name is |
44 |
| -# never "darwin". For macOS, you can check for sys.platform == "darwin". (As on other |
45 |
| -# Unix-like systems, os.name == "posix" on macOS. This is also the case on Cygwin.) |
46 |
| -# |
47 |
| -is_win:bool=os.name=="nt" |
| 44 | +is_win=os.name=="nt" |
48 | 45 | is_posix=os.name=="posix"
|
49 |
| -is_darwin=os.name=="darwin" |
| 46 | +is_darwin=sys.platform=="darwin" |
50 | 47 |
|
51 | 48 | defenc=sys.getfilesystemencoding()
|
52 | 49 |
|
|