Skip to content

Commit

Permalink
Fix the exception type and docstring of local plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 21, 2024
1 parent 5b6a82d commit c64bb05
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/aiida/transports/plugins/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,18 @@ def getfile(self, remotepath, localpath, *args, **kwargs):
"""Copies a file recursively from 'remote' remotepath to
'local' localpath.
:param remotepath: path to local file
:param localpath: absolute path to remote file
:param remotepath: absolute path to remote file
:param localpath: path to local file
:param overwrite: if True overwrites localpath.
Default = False
:raise OSError if 'remote' remotepath is not valid or not found
:raise ValueError: if 'local' localpath is not valid
:raise OSError: if unintentionally overwriting
"""
if not os.path.isabs(localpath):
raise ValueError('localpath must be an absolute path')

overwrite = kwargs.get('overwrite', args[0] if args else True)
if not localpath:
raise ValueError('Input localpath to get function must be a non empty string')
Expand Down

0 comments on commit c64bb05

Please sign in to comment.