diff --git a/src/stpipe/step.py b/src/stpipe/step.py index 1b725e63..11589387 100644 --- a/src/stpipe/step.py +++ b/src/stpipe/step.py @@ -1191,13 +1191,7 @@ def make_input_path(self, file_path): File path using ``input_dir`` if the input had no directory path. """ - full_path = file_path - if isinstance(file_path, str): - original_path, file_name = split(file_path) - if not len(original_path): - full_path = join(self.input_dir, file_name) - - return full_path + return _make_input_path(file_path, self.input_dir) def _set_input_dir(self, input_, exclusive=True): """Set the input directory @@ -1466,3 +1460,12 @@ def preserve_step_pars(step): yield saved_pars finally: step.update_pars(saved_pars) + + +def _make_input_path(file_path, input_dir): + full_path = file_path + if isinstance(file_path, str): + original_path, file_name = split(file_path) + if not len(original_path): + full_path = join(input_dir, file_name) + return full_path