diff Python/structmember.c @ 1848:b724599401ff legacy-trunk

Merge back to main trunk
author Guido van Rossum <guido@python.org>
date Tue, 30 Aug 1994 08:27:36 +0000
parents 1cabc2b6c970
children 3d431a521132
line wrap: on
line diff
--- a/Python/structmember.c	Tue Aug 30 08:19:36 1994 +0000
+++ b/Python/structmember.c	Tue Aug 30 08:27:36 1994 +0000
@@ -1,5 +1,5 @@
 /***********************************************************
-Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
 Amsterdam, The Netherlands.
 
                         All Rights Reserved
@@ -144,6 +144,11 @@
 				err_setstr(TypeError, "readonly attribute");
 				return -1;
 			}
+			if (v == NULL && l->type != T_OBJECT) {
+				err_setstr(TypeError,
+				  "can't delete numeric/char attribute");
+				return -1;
+			}
 			addr += l->offset;
 			switch (l->type) {
 			case T_BYTE: