New issue
Advanced search Search tips

Issue 690151 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

A cleaner way to handle import failures

Project Member Reported by dshi@chromium.org, Feb 8 2017

Issue description

In Autotest code, we use a lot of
try:
  import x
except ImportError:
  do sth else

A cleaner way could be 

Use importlib.import_module to write a utils function
 metrics = utils.safe_import('metrics', 'chromite.lib')

Proposed in this review:
https://chromium-review.googlesource.com/#/c/438754/2..3/scheduler/host_scheduler.py

 

Comment 1 by aut...@google.com, Feb 15 2017

Labels: -current-issue
Project Member

Comment 2 by sheriffbot@chromium.org, Feb 15 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Pri-2 -Hotlist-Recharge-Cold Pri-3
Status: Available (was: Untriaged)

Sign in to add a comment