Skip to content

Commit

Permalink
Merge pull request #177 from joscao/devel/sourcefile_with_source
Browse files Browse the repository at this point in the history
Sourcefile does not have a filepath
  • Loading branch information
reuterbal authored Nov 8, 2023
2 parents af8ec9f + 87bc181 commit 200343d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def jit_compile(source, filepath=None, objname=None):
Return a specific object (module or subroutine) in :attr:`source`
"""
if isinstance(source, Sourcefile):
filepath = source.filepath if filepath is None else Path(filepath)
filepath = source.path if filepath is None else Path(filepath)
if filepath is None:
filepath = Path(gettempdir()/filehash(source, prefix='', suffix='.f90'))
source.write(path=filepath)
else:
source = fgen(source)
Expand Down

0 comments on commit 200343d

Please sign in to comment.