Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fort_depend 2.0.0 crashes when module not defined #21

Open
lackyO3 opened this issue Sep 2, 2021 · 0 comments
Open

fort_depend 2.0.0 crashes when module not defined #21

lackyO3 opened this issue Sep 2, 2021 · 0 comments

Comments

@lackyO3
Copy link

lackyO3 commented Sep 2, 2021

This program:

program FortDependPrecompiledProg
  use ISO_FORTRAN_ENV
end program FortDependPrecompiledProg

produces this behavior:

/tis/releases/daniel.kahn/python-science/0.0.9/bin/fortdepend -f ~/TestFortran/TestFortDependProg.f90 -o TestDepend -w
Error module ISO_FORTRAN_ENV not defined in any files. Creating empty
Error module ISO_FORTRAN_ENV not defined in any files. Skipping...
Error module ISO_FORTRAN_ENV not defined in any files. Skipping...
Traceback (most recent call last):
  File "/tis/releases/daniel.kahn/python-science/0.0.9/bin/fortdepend", line 8, in <module>
    sys.exit(main())
  File "/tis/releases/daniel.kahn/python-science/0.0.9/lib/python3.8/site-packages/fortdepend/__main__.py", line 78, in main
    project.write_depends(filename=output, overwrite=args.overwrite, build=build,
  File "/tis/releases/daniel.kahn/python-science/0.0.9/lib/python3.8/site-packages/fortdepend/fort_depend.py", line 283, in write_depends
    program_deps = self.get_all_used_files(program)
  File "/tis/releases/daniel.kahn/python-science/0.0.9/lib/python3.8/site-packages/fortdepend/fort_depend.py", line 206, in get_all_used_files
    used_files = [self.modules[module].source_file.filename for module in used_modules]
  File "/tis/releases/daniel.kahn/python-science/0.0.9/lib/python3.8/site-packages/fortdepend/fort_depend.py", line 206, in <listcomp>
    used_files = [self.modules[module].source_file.filename for module in used_modules]
KeyError: 'ISO_FORTRAN_ENV'

Listing the offending module names after -i suppresses the errors and the crash, but I don't think it should crash without -i.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant