Skip to content

Commit

Permalink
fix: no-ops upload/download methods (#2571)
Browse files Browse the repository at this point in the history
* fix: Add exception to handle unconfigured upload/download methods

* docformatter fix

* no-ops

* no-ops 1
  • Loading branch information
hpohekar authored Mar 14, 2024
1 parent 8e34bda commit 5fc10d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ansys/fluent/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ def upload(self, file_name: str):
file_name : str
Name of the local file to upload to the server.
"""
return self._file_transfer_service.upload_file(file_name)
if self._file_transfer_service:
return self._file_transfer_service.upload_file(file_name)

def download(self, file_name: str, local_directory: Optional[str] = "."):
"""Download a file from the server.
Expand All @@ -293,7 +294,8 @@ def download(self, file_name: str, local_directory: Optional[str] = "."):
local_directory : str, optional
Local destination directory. The default is the current working directory.
"""
return self._file_transfer_service.download_file(file_name, local_directory)
if self._file_transfer_service:
return self._file_transfer_service.download_file(file_name, local_directory)

def __enter__(self):
return self
Expand Down

0 comments on commit 5fc10d9

Please sign in to comment.