diff --git a/src/local_ops.py b/src/local_ops.py index 8ea86ec..3981bc3 100644 --- a/src/local_ops.py +++ b/src/local_ops.py @@ -506,14 +506,7 @@ def path_exists(self, path: str) -> bool: @property def pathsep(self) -> str: - os_name = self.get_name() - if os_name == "posix": - pathsep = ":" - elif os_name == "nt": - pathsep = ";" - else: - raise Exception("Unsupported operating system: {}".format(os_name)) - return pathsep + return os.path.pathsep def mkdtemp(self, prefix: typing.Optional[str] = None) -> str: assert prefix is None or type(prefix) is str diff --git a/src/remote_ops.py b/src/remote_ops.py index 0caaac5..fc8fb77 100644 --- a/src/remote_ops.py +++ b/src/remote_ops.py @@ -421,10 +421,7 @@ def set_env( return def get_name(self): - cmd = 'python3 -c "import os; print(os.name)"' - stdout = self.exec_command(cmd, encoding=get_default_encoding()) - assert type(stdout) is str - return stdout.strip() + return "posix" # Work with dirs def makedirs( @@ -606,14 +603,7 @@ def path_exists(self, path: str) -> bool: @property def pathsep(self) -> str: - os_name = self.get_name() - if os_name == "posix": - pathsep = ":" - elif os_name == "nt": - pathsep = ";" - else: - raise Exception("Unsupported operating system: {}".format(os_name)) - return pathsep + return posixpath.pathsep def mkdtemp(self, prefix: typing.Optional[str] = None) -> str: """