iipeace / guider

A Practically Applicable Performance Analyzer for Real Product Development
https://iipeace.github.io/docs/guider.html
GNU General Public License v2.0
629 stars 92 forks source link

Fix exception handling for the import of essential modules #260

Open elfring opened 3 years ago

elfring commented 3 years ago

The script “guider.py” contains the following source code at the moment.

…
try:
…
    import sys
…

I doubt that the specified exception handling can work if the mentioned statement failed. :thinking:

…
except ImportError:
    err = sys.exc_info()[1]
…
iipeace commented 3 years ago

@elfring You are right! It can be shown strange logically, But I think it is impossible to fail to import sys module in python :)

elfring commented 3 years ago

How do you think about to split the affected code so that it will be correct? :thinking:

iipeace commented 3 years ago

@elfring I agree with you! I'll split them :)