Opened 5 years ago

Closed 5 years ago

#15114 closed (duplicate)

module_has_submodule can report false positives

Reported by: shields Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Python caches failed relative imports using a None in sys.modules. However, module_has_submodule only checks to see whether a key is present in sys.modules, so it can incorrectly report that a module exists when it doesn't.

Attached is a patch (one line, plus a comment) and a regression test.

The patch is against trunk, but the bug also affects 1.2.

Attachments (1)

sys-modules-none.diff (1.3 KB) - added by shields 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by shields

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #14698

Note: See TracTickets for help on using tickets.
Back to Top