Skip to content

Python 3/imports: use importlib instead of calling __import__ function directly #8768

@josephsl

Description

@josephsl

Hi,

Stemming from an observation in #8712: Python 2 does come with importlib, which does have a more elegant way of loading modules via importlib.import_module. This is more readable than using import function directly.

Steps to reproduce:

Try using both import and importlib.impot_module to load an external module.

Actual behavior:

Module loads via either method.

Expected behavior:

Module loads.

System configuration:

NVDA Installed/portable/running from source:

N/A

NVDA version:

N/A

Windows version:

N/A

Name and version of other software in use when reproducing the issue:

Python 2.7.15, 3.7.0

Other information about your system:

N/A

Other questions:

Does the issue still occur after restarting your PC?

N/A

Have you tried any other versions of NVDA?

N/A

When this should be implemented:

Preferably as part of NVDA 2019.1.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions