Opened 11 years ago

Closed 11 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: master
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


django/core/management/commands/ 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@… 11 years ago.
patch.patch (683 bytes) - added by Maciej Fijalkowski 11 years ago.

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by anto.cuni@…

Attachment: pypy-compatible.patch added

comment:1 Changed 11 years ago by anonymous

Cc: anto.cuni@… added

comment:2 Changed 11 years ago by Jacob

Keywords: vm-compat added
Triage Stage: UnreviewedAccepted

comment:3 Changed 11 years ago by Adrian Holovaty

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 Changed 11 years ago by Maciej Fijalkowski

Resolution: fixed
Status: closedreopened

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

Changed 11 years ago by Maciej Fijalkowski

Attachment: patch.patch added

comment:5 Changed 11 years ago by Russell Keith-Magee

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

comment:6 Changed 11 years ago by Russell Keith-Magee

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