From 20ba323d184b15e7593c5e62724388e1712e4f0a Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sat, 16 Jun 2018 16:07:51 +0300 Subject: [PATCH] metrics: don't try to read metrics if file doesn't exist Signed-off-by: Ruslan Kuprieiev --- dvc/project.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dvc/project.py b/dvc/project.py index 4eaabcc11..1cea1725b 100644 --- a/dvc/project.py +++ b/dvc/project.py @@ -321,6 +321,10 @@ class Project(object): def _read_metric(self, path, json_path=None, tsv_path=None, htsv_path=None): ret = None + + if not os.path.exists(path): + return ret + try: with open(path, 'r') as fd: if json_path: @@ -332,7 +336,7 @@ class Project(object): else: ret = fd.read() except Exception as exc: - self.logger.error('Unable to read metric in \'{}\''.format(path), exc) + self.logger.debug('Unable to read metric in \'{}\''.format(path), exc) return ret