Skip to content

Commit

Permalink
combine str and Path
Browse files Browse the repository at this point in the history
  • Loading branch information
hpohekar committed Apr 19, 2024
1 parent dca3361 commit 56fd059
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/ansys/fluent/core/utils/file_transfer_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,8 @@ def _get_files(
file_name: Union[str, pathlib.PurePath, list[Union[str, pathlib.PurePath]]],
path: Optional[str],
):
if isinstance(file_name, str):
file_path_check = os.path.join(path, os.path.basename(file_name))
files = (
[str(file_path_check)] if os.path.isfile(file_path_check) else [file_name]
)
elif isinstance(file_name, pathlib.PurePath):
if isinstance(file_name, (str, pathlib.PurePath)):
file_name = pathlib.Path(file_name)
file_path_check = os.path.join(path, file_name.name)
files = [file_path_check] if os.path.isfile(file_path_check) else [file_name]
elif isinstance(file_name, list):
Expand Down

0 comments on commit 56fd059

Please sign in to comment.