Opened 15 years ago
Closed 15 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)
Change History (2)
by , 15 years ago
| Attachment: | sys-modules-none.diff added |
|---|
comment:1 by , 15 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Duplicate of #14698