Skip to content

Commit

Permalink
feat: fully resolve outPath for cleaner error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Renfu-Li committed Jan 2, 2024
1 parent 3d06c76 commit 58c6d5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/onc/modules/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def saveAsFile(

# Save file in outPath if it doesn't exist yet
if Path.exists(filePath) and not overwrite:
raise FileExistsError(filePath.resolve())
raise FileExistsError(filePath)
with open(filePath, "wb+") as file:
file.write(response.content)

Expand Down
4 changes: 2 additions & 2 deletions src/onc/onc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(
self.showInfo = showInfo
self.timeout = timeout
self.baseUrl = "https://data.oceannetworks.ca/"
self._out_path = Path(outPath)
self._out_path = Path(outPath).resolve()

# Switch to qa if needed
if not production:
Expand All @@ -49,7 +49,7 @@ def outPath(self):

@outPath.setter
def outPath(self, outPath):
self._out_path = Path(outPath)
self._out_path = Path(outPath).resolve()

def print(self, obj, filename: str = ""):
"""
Expand Down

0 comments on commit 58c6d5d

Please sign in to comment.