Python 3 imports: additional work on builtins, relative imports, importlib (PR #8727)
Fixes #8712
Fixes #8724
Fixes #8768
Support Python 3 style imports. Python 3 wants a dot (.) when importing modules from the same folder. When using __import__ function, the level argument specifies search level (default is 0). Thus allow other IAccessible modules to be loaded by specifying level of 1 (relative import from the same folder).
Changes made:
- Use importlib to import modules at runtime, including for IAccessible modules #8712
- GUI and IAccessible objects: relative imports (from . import ...) #8724
- Import builtin -> builtins (Python Console, language handler) #8768
- Python 2.7 includes a base implementation of importlib which powers __import__ function, with Python 3 providing more features such as importers. Thus use importlib.import_module in app module handler and others, specifying appropriate package names in the process. Because importlib.import_module complains about module names, spell the module name (NVDAObjects.IAccessible.mod).
- HRESULT no longer exists in ctypes.wintypes in Python 3. The new location is ctypes.HRESULT. Even in Python 2, ctypes.wintypes.HRESULT points to ctypes.HRESULT.