Skip to content

package `imp' used in iostream.py is deprecated since Python 3.4 #560

@slayoo

Description

@slayoo

from imp import lock_held as import_lock_held

Running with ``python -We'' (treat warnings as errors), this causes:

  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/ipykernel/iostream.py", line 12, in <module>

    from importlib import lock_held as import_lock_held

ImportError: cannot import name 'lock_held' from 'importlib' (/home/travis/virtualenv/python3.8.0/lib/python3.8/importlib/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/opt/python/3.8.0/lib/python3.8/runpy.py", line 192, in _run_module_as_main

    return _run_code(code, main_globals, None,

  File "/opt/python/3.8.0/lib/python3.8/runpy.py", line 85, in _run_code

    exec(code, run_globals)

  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/ipykernel/__main__.py", line 2, in <module>

    from ipykernel import kernelapp as app

  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 38, in <module>

    from .iostream import IOPubThread

  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/ipykernel/iostream.py", line 14, in <module>

    from imp import lock_held as import_lock_held

  File "/home/travis/virtualenv/python3.8.0/lib/python3.8/imp.py", line 31, in <module>

    warnings.warn("the imp module is deprecated in favour of importlib; "

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

The proposed alternative is importlib: https://docs.python.org/3/library/importlib.html#module-importlib

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions