From 2db155efff4e925f773600f1a1f109b9e2ee6f0c Mon Sep 17 00:00:00 2001 From: japm48 <japm48@users.noreply.github.com> Date: Wed, 30 Sep 2020 02:33:06 +0200 Subject: grc: use os.pathsep (Windows) os.path.sep is unreliable in Windows ("\" in official python, "/" in MSYS2) With this change os.pathsep is used instead to get the path separator: ":" (*nix) or ";" (Windows) --- grc/core/Config.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'grc/core/Config.py') diff --git a/grc/core/Config.py b/grc/core/Config.py index df80528a74..916d5be962 100644 --- a/grc/core/Config.py +++ b/grc/core/Config.py @@ -29,8 +29,6 @@ class Config(object): @property def block_paths(self): - path_list_sep = {'/': ':', '\\': ';'}[os.path.sep] - paths_sources = ( self.hier_block_lib_dir, os.environ.get('GRC_BLOCKS_PATH', ''), @@ -38,7 +36,7 @@ class Config(object): self._gr_prefs.get_string('grc', 'global_blocks_path', ''), ) - collected_paths = sum((paths.split(path_list_sep) + collected_paths = sum((paths.split(os.pathsep) for paths in paths_sources), []) valid_paths = [normpath(expanduser(expandvars(path))) -- cgit v1.2.3