Skip to content

Commit a5b2d30

Browse files
committed
refactor: handle None case for Path initialization in resources.py and parse_args.py
1 parent f607e2a commit a5b2d30

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

libensemble/resources/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def get_global_nodelist(node_file=Resources.DEFAULT_NODEFILE, rundir=None, env_r
296296
297297
In dedicated mode, any node with a libE worker is removed from the list.
298298
"""
299-
top_level_dir = Path(rundir) or Path.cwd()
299+
top_level_dir = Path(rundir) if rundir else Path.cwd()
300300
node_filepath = top_level_dir / node_file
301301
global_nodelist = []
302302
if os.path.isfile(node_filepath):

libensemble/tools/parse_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def _tcp_parse_args(args):
116116
def _ssh_parse_args(args):
117117
"""Parses arguments for SSH with reverse tunnel."""
118118
nworkers = len(args.workers)
119-
worker_pwd = Path(args.worker_pwd) or Path.cwd()
119+
worker_pwd = Path(args.worker_pwd) if args.worker_pwd else Path.cwd()
120120
script_dir, script_name = os.path.split(sys.argv[0])
121121
worker_script_name = worker_pwd / script_name
122122
ssh = ["ssh", "-R", "{tunnel_port}:localhost:{manager_port}", "{worker_ip}"]

0 commit comments

Comments
 (0)