Skip to content

importlib.abc: NameError: name 'warnings' is not defined #121279

Closed
@hroncok

Description

@hroncok

Bug report

Bug description:

>>> import importlib.abc
>>> importlib.abc.TraversableResources
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    importlib.abc.TraversableResources
  File "/usr/lib64/python3.13/importlib/abc.py", line 34, in __getattr__
    warnings._deprecated(f"{__name__}.{name}", remove=(3, 14))
    ^^^^^^^^
NameError: name 'warnings' is not defined. Did you mean: 'Warning'? Or did you forget to import 'warnings'?

This is a result of #120429

Thew change on the main branch correctly removed unused import warnings, but ti got backported to 3.13 where the import is used.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions