Skip to content

Commit 130dc43

Browse files
authored
JP-3862: Fix Path methods issue found by sonarscan (#9427)
1 parent 7c8a5bd commit 130dc43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jwst/associations/tests/make_headers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def actual_path(path):
2525
Path
2626
The fully qualified path.
2727
"""
28-
return Path.abspath(ospath.expandvars(Path.expanduser(path)))
28+
return Path(ospath.expandvars(path)).expanduser().resolve()
2929

3030

3131
def get_headers(files, outpath):
@@ -40,7 +40,7 @@ def get_headers(files, outpath):
4040
The output path to place the header-only files
4141
"""
4242
for path in files:
43-
name = Path.name(path)
43+
name = Path(path).name
4444
hdul = fits.open(path)
4545
nhdu = fits.PrimaryHDU(header=hdul[0].header)
4646
nhdul = fits.HDUList([nhdu])

0 commit comments

Comments
 (0)