Opened 14 years ago

Closed 14 years ago

#15114 closed (duplicate)

module_has_submodule can report false positives

Reported by: Michael Shields Owned by: nobody
Component: Uncategorized Version: dev
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

Description

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 14 years ago.

Download all attachments as: .zip

Change History (2)

by Michael Shields, 14 years ago

Attachment: sys-modules-none.diff added

comment:1 by Russell Keith-Magee, 14 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #14698

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