From 667bb5ac17373794061ec4d9cce135bb542a5be0 Mon Sep 17 00:00:00 2001 From: Aaron Snoswell Date: Wed, 20 Feb 2019 22:24:46 +1000 Subject: [PATCH] Use os.sep for path separators Supports a fix for #117 --- spinup/utils/plot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spinup/utils/plot.py b/spinup/utils/plot.py index e8d253dab..92e80871d 100644 --- a/spinup/utils/plot.py +++ b/spinup/utils/plot.py @@ -105,12 +105,12 @@ def get_all_datasets(all_logdirs, legend=None, select=None, exclude=None): """ logdirs = [] for logdir in all_logdirs: - if osp.isdir(logdir) and logdir[-1]=='/': + if osp.isdir(logdir) and logdir[-1]==os.sep: logdirs += [logdir] else: basedir = osp.dirname(logdir) fulldir = lambda x : osp.join(basedir, x) - prefix = logdir.split('/')[-1] + prefix = logdir.split(os.sep)[-1] listdir= os.listdir(basedir) logdirs += sorted([fulldir(x) for x in listdir if prefix in x])