Open pydanny opened 1 year ago
To produce the error:
import grimp graph = grimp.build_graph("nifty_library", include_external_packages=True) graph.find_modules_that_directly_import('yaml')
This results in this error:
----> 1 graph.find_modules_that_directly_import('yaml') File ~/.virtualenvs/kraken-core/lib/python3.10/site-packages/grimp/adaptors/graph.py:234, in ImportGraph.find_modules_that_directly_import(self, module) 233 def find_modules_that_directly_import(self, module: str) -> Set[str]: --> 234 return self._importers_by_imported[module] KeyError: 'yaml'
Thanks for the bug report, yes I agree we could do better here. I think we should raise grimp.exceptions.ModuleNotPresent in this case, which is already raised from some other methods under similar circumstances.
grimp.exceptions.ModuleNotPresent
To produce the error:
This results in this error: