Skip to content

Pynac should check for errors when calling PyObject_RichCompareBool() #24522

@embray

Description

@embray

There are a number of methods in pynac's ginac/numeric.cpp module that don't check for error results from PyObject_RichCompareBool (which returns -1 on error).

This leads to unhandled exceptions that, on Python 2, were somewhat by luck being cleared via PyObject_Clear() later in the call stack.

On Python 3, the interpreter asserts PyErr_Occurred in more places and we don't get so lucky.

Upstream PR: pynac/pynac#297

Upstream: Fixed upstream, in a later stable release.

CC: @rwst

Component: packages: standard

Keywords: pynac

Issue created by migration from https://trac.sagemath.org/ticket/24522

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions