How do I disable the unresolved import errors only for a section of code, just like I can disable certain errors in Pylint?
I have this code and I would like to disable the import unresolved error just for the part inside the exception clause, while keeping it globally.
try:
from .utilities import gc_enable, log_line, log_title, logging_configuration
from .utilities import remove_file, save_object_to_json, load_object_from_json, update_json_dict
from .enums import SetType, LoadDatasetOptions
except ImportError:
# The pylint command doesn't work
# pylint: disable=unresolved-import
from utilities import gc_enable, log_line, log_title, logging_configuration
from utilities import remove_file, save_object_to_json, load_object_from_json, update_json_dict
from enums import SetType, LoadDatasetOptions
# pylint: enable=unresolved-import
This code is here only while I am still developing the module, but it bothers me that I get these errors.