This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: The result of set_copy() is not checked for NULL
Type: performance Stage:
Components: None Versions: Python 2.5.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: CWRU_Researcher1, mark.dickinson, rhettinger
Priority: normal Keywords:

Created on 2008-11-29 17:12 by CWRU_Researcher1, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg76606 - (view) Author: Brian Szuter (CWRU_Researcher1) Date: 2008-11-29 17:12
Python-2.5.2/Objects/setobject.c
Line 1204

The result of set_copy() is not checked for NULL.

[See Objects/setobject.c(set_difference) for example of correct usage]
msg76608 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-11-29 17:31
I believe the code is correct as it is.  The relevant lines are in
set_intersection:

	if ((PyObject *)so == other)
		return set_copy(so);

If the result of the set_copy is NULL then the NULL is passed directly 
back to the calling routine;  this is as it should be.  A NULL coming from 
set_copy indicates that an exception occurred; this is then passed on to 
the calling routine so that the calling routine is aware of the exception.

If you haven't already done so, please take a look at

http://docs.python.org/dev/c-api/index.html

especially the section on exception handling.
msg76610 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-11-29 17:37
The code is correct as-is.
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48715
2008-11-29 17:37:51rhettingersetnosy: + rhettinger
messages: + msg76610
2008-11-29 17:31:09mark.dickinsonsetstatus: open -> closed
resolution: not a bug
messages: + msg76608
nosy: + mark.dickinson
2008-11-29 17:12:26CWRU_Researcher1create