Georg Brandl
d9ca66f2b2
Backport: Fix missing NULL checks after PyTuple_New, PyList_New, PyDict_New
2006-03-17 19:04:15 +00:00
Armin Rigo
0b61a45223
Backported from r41842.
2006-02-20 10:21:14 +00:00
Guido van Rossum
b693c1cea0
- On 64-bit platforms, when __len__() returns a value that cannot be
...
represented as a C int, raise OverflowError.
(Will forward-port.)
2005-09-20 16:36:07 +00:00
Anthony Baxter
d855c5888e
fix int.__divmod__.__doc__
2005-06-03 14:13:47 +00:00
Raymond Hettinger
ace3f61994
Convert "__init__ should return None" from an exception to a warning.
2005-03-04 04:47:04 +00:00
Raymond Hettinger
2a06df6258
SF bug #1155938 : Missing None check for __init__().
2005-03-03 16:55:53 +00:00
Tim Peters
f4aca755bc
A static swapped_op[] array was defined in 3 different C files, & I think
...
I need to define it again. Bite the bullet and define it once as an
extern, _Py_SwappedOp[].
2004-09-23 02:39:37 +00:00
Martin v. Löwis
bf608750ad
Patch #980082 : Missing INCREF in PyType_Ready.
2004-08-18 13:16:54 +00:00
Michael W. Hudson
3f3b66823f
Repair the same thinko in two places about handling of _Py_RefTotal in
...
the case of __del__ resurrecting an object.
This makes the apparent reference leaks in test_descr go away (which I
expected) and also kills off those in test_gc (which is more surprising
but less so once you actually think about it a bit).
2004-08-03 10:21:03 +00:00
Raymond Hettinger
8d726eef96
Cosmetic spacing fix.
2004-06-25 22:24:35 +00:00
Raymond Hettinger
d56cbe57b8
Fix leak found by Eric Huss.
2004-06-25 22:17:39 +00:00
Anthony Baxter
3ecdb250af
Fix for bug #966623 - classes created with type() in an exec(, {}) don't
...
have a __module__. Test for this case.
Bugfix candidate, will backport.
2004-06-11 14:41:18 +00:00
Hye-Shik Chang
ff365c931b
Get rid of gcc warning.
2004-03-25 16:37:03 +00:00
Phillip J. Eby
91a968af76
Ensure super() lookup of descriptor from classmethod works (SF #743627 )
2004-03-25 02:19:34 +00:00
Jim Fulton
8a1a594590
Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol
...
2. Failure to clear the error when attempts to get the __getstate__
attribute fail caused intermittent errors and odd behavior.
2004-02-08 04:21:26 +00:00
Raymond Hettinger
6a8bbdbe7b
Improve argument checking speed.
2003-12-13 15:21:55 +00:00
Raymond Hettinger
8f5cdaa784
* Added a new method flag, METH_COEXIST.
...
* Used the flag to optimize set.__contains__(), dict.__contains__(),
dict.__getitem__(), and list.__getitem__().
2003-12-13 11:26:12 +00:00
Tim Peters
0bd743cee1
subtype_dealloc(): Simplified overly contorted retracking logic. With
...
this change, I think subtype_dealloc is actually a smidgen less obscure
than it was in 2.3 -- we got rid of a negation in an "if" <wink>.
2003-11-13 22:50:00 +00:00
Tim Peters
f7f9e9966b
subtype_dealloc(): A more complete fix for critical bug 840829 +
...
expanded the test case with a piece that needs the more-complete fix.
I'll backport this to 2.3 maint.
2003-11-13 21:59:32 +00:00
Tim Peters
add09b4149
SF bug 840829: weakref callbacks and gc corrupt memory.
...
subtype_dealloc(): This left the dying object exposed to gc, so that
if cyclic gc triggered during the weakref callback, gc tried to delete
the dying object a second time. That's a disaster. subtype_dealloc()
had a (I hope!) unique problem here, as every normal dealloc routine
untracks the object (from gc) before fiddling with weakrefs etc. But
subtype_dealloc has obscure technical reasons for re-registering the
dying object with gc (already explained in a large comment block at
the bottom of the function).
The fix amounts to simply refraining from reregistering the dying object
with gc until after the weakref callback (if any) has been called.
This is a critical bug (hard to predict, and causes seemingly random
memory corruption when it occurs). I'll backport it to 2.3 later.
2003-11-12 20:43:28 +00:00
Walter Dörwald
f0dfc7ac5c
Fix a bunch of typos in documentation, docstrings and comments.
...
(From SF patch #810751 )
2003-10-20 14:01:56 +00:00
Raymond Hettinger
8ae4689657
Simplify and speedup uses of Py_BuildValue():
...
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c)
* Py_BuildValue("()",a) --> PyTuple_New(0)
* Py_BuildValue("O", a) --> Py_INCREF(a)
2003-10-12 19:09:37 +00:00
Raymond Hettinger
56bb16f1b3
Use the simpler and faster PyArg_UnpackTuple() instead of
...
PyArg_ParseTuple() where possible.
2003-10-11 19:32:18 +00:00
Raymond Hettinger
f34f2646a1
SF bug #820397 : __nonzero__() returns 1/0
...
Altered to return a PyBool instead of a PyInt.
Backport candidate.
2003-10-11 17:29:04 +00:00
Guido van Rossum
22c3dda1e6
Fix leak introduced by previous typeobject.c checkin.
2003-10-09 03:46:35 +00:00