One change I would like to see is making the distinction on "startup" and selecting the appropriate function for future use, like so:
# global scope
try: import psutil if psutil.__version__ < (...): throw Something() prep_display = _prep_disp_using_psutil except ( ImportError, Someting): prep_display = _prep_disp_using_proc
This way we don't go deep into psutil use exception as a code flow.
« Back to merge proposal
One change I would like to see is making the distinction on "startup" and selecting the appropriate function for future use, like so:
# global scope
try: using_psutil using_proc
import psutil
if psutil.__version__ < (...):
throw Something()
prep_display = _prep_disp_
except ( ImportError, Someting):
prep_display = _prep_disp_
This way we don't go deep into psutil use exception as a code flow.