Skip to content

DeprecationWarning: the imp module is deprecated in favour of importlib #207

Description

@ogrisel

Modules such as scikit-learn that use cloudpickle and do not filer DeprecationWarning get the following when importing cloudpickle.

DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp

Another way to display this is to launch python with the -Wd flag:

$ python -Wd -c "import cloudpickle"
/path/to/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp

We should therefore refactor cloudpickle to use importlib instead of imp while taking care of not breaking backward compat.

We should also run the tests of cloudpickle in a way that they would fail in case of uncaught deprecation warnings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions