Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3356 closed Bugs (fixed)

operator! does not check for errors

Reported by: Stefan Seefeld Owned by: Dave Abrahams
Milestone: Boost 1.41.0 Component: python USE GITHUB
Version: Boost 1.39.0 Severity: Problem
Keywords: Cc: rwgk@…

Description

operator! (as well as the bool conversion operator) call PyObject_IsTrue, and convert the result to a boolean, even though the result may be an error (e.g., -1).

Here is a fix.

Attachments (1)

patch (893 bytes ) - added by Stefan Seefeld 13 years ago.

Download all attachments as: .zip

Change History (3)

by Stefan Seefeld, 13 years ago

Attachment: patch added

comment:1 by Ralf W. Grosse-Kunstleve, 13 years ago

Cc: rwgk@… added
Resolution: fixed
Status: newclosed

I've checked in a similar patch as svn trunk rev. 55708. The differences are to use the throw_error_already_set() function and to stay a close as possible to the original code (avoid == 1). I'll ask Beman for permission to merge the change into the release branch. Ralf

comment:2 by Ralf W. Grosse-Kunstleve, 13 years ago

For the records: svn rev. 55742 merges the patch into the release branch.

Note: See TracTickets for help on using tickets.