_has_torch_function already has a docstring

To avoid issues with conflicting versions of torch, I’m doing the following:

remove conflicting versions:

def backupmodules_and_remove():
    # Store original modules in a global variable
    old_modules = {}
    for m in ['torch','PIL']:
        for module_name in list(sys.modules):
            if module_name == m or module_name.startswith(m + "."):
                # Store the current module in a dictionary
                old_modules[module_name] = sys.modules[module_name]
                # Remove the current module
                del sys.modules[module_name]

import correct versions after adding my module folder to the top of sys.path and invalidating caches with importlib:

def import_addon_modules():
    try:
        for m in ['torch','PIL']:
            importlib.import_module(m)
    except Exception as e:
        print('\nEXCEPTION IN IMPORT MODULES\n')
        print(str(e))

import_addon_modules throws this error: function '_has_torch_function' already has a docstring

I can’t use a virtual environment because I’m developing a Blender addon, hence the need to remove incorrect versions prior to my code running, and then putting it all back so other addons can continue to use the versions they require.

This is with the current torch version (cpu), and python 3.11.7 inside of Blender.