summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-02-05 09:46:15 (GMT)
committerGuido van Rossum <guido@python.org>1993-02-05 09:46:15 (GMT)
commit6f5afc9a73d7388bf96df69323589f2f82c110ba (patch)
treef642f4a5f0d1a136b4480575460662deb89d7502 /Python/ceval.c
parent995c33a2bbb540729e3330ed8f11365e578ab5a0 (diff)
downloadcpython-6f5afc9a73d7388bf96df69323589f2f82c110ba.zip
cpython-6f5afc9a73d7388bf96df69323589f2f82c110ba.tar.gz
cpython-6f5afc9a73d7388bf96df69323589f2f82c110ba.tar.bz2
* ceval.c: ifdef out the last argument passing compat hack.
* Fixed memory leaks in socket, select and sv modules: mkvalue("O", v) does INCREF(v) so if v is brand new it should be XDECREF'd
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b28f17c..727bc0c 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -786,13 +786,6 @@ eval_code(co, globals, locals, arg)
break;
case UNPACK_ARG:
- /* Implement various compatibility hacks:
- (a) f(a,b,...) should accept f((1,2,...))
- (b) f((a,b,...)) should accept f(1,2,...)
- (c) f(self,(a,b,...)) should accept f(x,1,2,...)
- Actually, (c) is dangerous, and (b) seems
- unnecessary, but (a) can't be missed...
- */
{
int n;
if (EMPTY()) {
@@ -809,6 +802,12 @@ eval_code(co, globals, locals, arg)
break;
}
n = gettuplesize(v);
+#ifdef COMPAT_HACKS
+/* Implement various compatibility hacks (for 0.9.4 or earlier):
+ (a) f(a,b,...) accepts f((1,2,...))
+ (b) f((a,b,...)) accepts f(1,2,...)
+ (c) f(self,(a,b,...)) accepts f(x,1,2,...)
+*/
if (n == 1 && oparg != 1) {
/* Rule (a) */
w = gettupleitem(v, 0);
@@ -819,7 +818,6 @@ eval_code(co, globals, locals, arg)
n = gettuplesize(v);
}
}
-#ifdef COMPAT_HACKS /* Compatibility hacks no longer needed (I think) */
else if (n != 1 && oparg == 1) {
/* Rule (b) */
PUSH(v);