-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I see that you download the mslex independent of OS:
Line 17 in 2ba655f
| "mslex", |
But if a user-OS is, as example, Linux, it is not required. And there is a special mechanism for OS-specific dependensies. I suggest you to use it.
And if you'll go this way, you probably can throw away code like this:
def is_posix() -> bool:
"""
Returns whether the system running Python is POSIX compatible.
This is the condition for oslex.underlying being shlex.
This is also the condition for os.path being posixpath.
"""
return 'posix' in sys.builtin_module_names
def is_windows() -> bool:
"""
Returns whether the system running Python is Windows based.
This is the condition for oslex.underlying being mslex.
This is also the condition for os.path being ntpath.
"""
if is_posix():
# This early return is likely redundant, but we want to be 100% equivalent to the if-elseif structure found in os.py
# See https://github.com/python/cpython/blob/3.7/Lib/os.py
return False
return 'nt' in sys.builtin_module_namesReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels