diff --git a/src/pyserv/settings.py b/src/pyserv/settings.py index cfb5f7e..a11c8b3 100644 --- a/src/pyserv/settings.py +++ b/src/pyserv/settings.py @@ -37,13 +37,12 @@ def init_dirs(dirs): usr_path.mkdir(parents=True, exist_ok=True) -def platform_check(): +def platform_check() -> bool: """ Check to see if we think we are POSIX. - :return list: valid platform name + :return we_are_posix: true if system is posix """ - valid_os = [] myname = sys.platform is_posix = os.name == 'posix' posix_list = [ @@ -52,9 +51,8 @@ def platform_check(): 'openbsd', 'freebsd', ] - valid_os = [x for x in posix_list if x in myname and is_posix] - - return valid_os + we_are_posix = myname in posix_list and is_posix + return we_are_posix def show_uservars(): diff --git a/tests/test_extras.py b/tests/test_extras.py index 88f7031..b94f38a 100644 --- a/tests/test_extras.py +++ b/tests/test_extras.py @@ -32,7 +32,7 @@ def test_get_userdirs(): else: assert logdir.name == 'log' - assert piddir.name == 'pyserv' + assert piddir.name == 'pyserv' or 'Cache' assert docdir.name == Path.cwd().name