Skip to content

Commit

Permalink
Use ModuleNotFoundError over ImportError
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Jul 4, 2023
1 parent 351b435 commit 060fedb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chroma_feedback/consumer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ def process(program : ArgumentParser, producer_report : List[ProducerReport]) ->
def load_consumer(consumer_name : str) -> Any:
try:
return importlib.import_module(consumer.ALL[consumer_name])
except ImportError:
except ModuleNotFoundError:
logger.error(wording.get('consumer_not_found').format(consumer.ALL[consumer_name]) + wording.get('exclamation_mark'))
sys.exit()
2 changes: 1 addition & 1 deletion chroma_feedback/producer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ def process(program : ArgumentParser) -> List[Producer]:
def load_producer(producer_name : str) -> Any:
try:
return importlib.import_module(producer.ALL[producer_name])
except ImportError:
except ModuleNotFoundError:
logger.error(wording.get('producer_not_found').format(producer.ALL[producer_name]) + wording.get('exclamation_mark'))
sys.exit()

0 comments on commit 060fedb

Please sign in to comment.