Skip to content

Commit

Permalink
fix pytest error
Browse files Browse the repository at this point in the history
  • Loading branch information
SunsetWolf committed Dec 13, 2024
1 parent 0dc0f38 commit 202fc96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qlib/workflow/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pickle
import tempfile
import subprocess
import platform
from pathlib import Path
from datetime import datetime

Expand Down Expand Up @@ -316,7 +317,10 @@ def get_local_dir(self):
This function will return the directory path of this recorder.
"""
if self.artifact_uri is not None:
local_dir_path = Path(self.artifact_uri.lstrip("file:").lstrip("/")).parent
if platform.system() == "Linux":
local_dir_path = Path(self.artifact_uri.lstrip("file:")).parent
else:
local_dir_path = Path(self.artifact_uri.lstrip("file:").lstrip("/")).parent
local_dir_path = str(local_dir_path.resolve())
if os.path.isdir(local_dir_path):
return local_dir_path
Expand Down

0 comments on commit 202fc96

Please sign in to comment.