Code review comment for ~sylvain-pineau/checkbox-ng:no_psutil_xenial

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

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