Opened 8 years ago

Closed 8 years ago

#15114 closed (duplicate)

module_has_submodule can report false positives

Reported by: Michael 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: no UI/UX: no


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 Michael Shields 8 years ago.

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by Michael Shields

Attachment: sys-modules-none.diff added

comment:1 Changed 8 years ago by Russell Keith-Magee

Resolution: duplicate
Status: newclosed

Duplicate of #14698

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