| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c01fe76 commit 562bdee
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,17 +36,14 @@ | |||
| 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 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments