Opened 16 years ago

Closed 16 years ago

#7421 closed (fixed)

Don't check the exact error message of exceptions

Reported by: anto.cuni@… Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords: vm-compat
Cc: anto.cuni@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django/core/management/commands/syncdb.py checks for the exact error message when catching an ImportError exception.
This test could fail on implementations other than CPython, is they choose to format the error messages slightly differently, as for example PyPy does.
The attacched patch solves this problem.

Attachments (2)

pypy-compatible.patch (648 bytes ) - added by anto.cuni@… 16 years ago.
patch.patch (683 bytes ) - added by Maciej Fijalkowski 16 years ago.

Download all attachments as: .zip

Change History (8)

by anto.cuni@…, 16 years ago

Attachment: pypy-compatible.patch added

comment:1 by anonymous, 16 years ago

Cc: anto.cuni@… added

comment:2 by Jacob, 16 years ago

Keywords: vm-compat added
Triage Stage: UnreviewedAccepted

comment:3 by Adrian Holovaty, 16 years ago

Resolution: fixed
Status: newclosed

(In [7623]) Fixed #7421 -- Improved syncdb implementation not to check for exact exception text, in case of alternate Python implementation. Thanks, anto.cuni@…

comment:4 by Maciej Fijalkowski, 16 years ago

Resolution: fixed
Status: closedreopened

Actually commited thing was not exactly the same as attached patch. Attaching new patch which makes logic work again.

by Maciej Fijalkowski, 16 years ago

Attachment: patch.patch added

comment:5 by Russell Keith-Magee, 16 years ago

To make it easier to validate your patch - what does PyPy return in the error message?

comment:6 by Russell Keith-Magee, 16 years ago

Resolution: fixed
Status: reopenedclosed

(In [7891]) Fixed #7421 -- Corrected the condition used during syncdb to establish that a management module is or isn't available. This is to satisfy non-CPython implementations which can use different error messages. Thanks to Maciej Fijalkowski (fijal) for his help confirming the problem.

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