diff options
author | japm48 <japm48@users.noreply.github.com> | 2020-09-30 02:33:06 +0200 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-09-30 12:36:35 -0400 |
commit | 2db155efff4e925f773600f1a1f109b9e2ee6f0c (patch) | |
tree | 51d23573edd7b2a9ee49721a526ed403150b6ecf /grc/core/Config.py | |
parent | 22e210bd5a165ba8db4767e2a4214b6e4bf4ac33 (diff) |
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)
Diffstat (limited to 'grc/core/Config.py')
-rw-r--r-- | grc/core/Config.py | 4 |
1 files changed, 1 insertions, 3 deletions
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))) |