diff Python/ceval.c @ 45820:79fdc88ff9ec legacy-trunk

Clean up the Py3k warnings for non-BaseException-subclasses a bit. We now don't warn for some corner cases that deserve a warning, rather than warning double or incorrectly for some other corner cases.
author Guido van Rossum <guido@python.org>
date Tue, 18 Mar 2008 03:15:05 +0000
parents ff0ab7b28f49
children 27e7dc2e6290
line wrap: on
line diff
--- a/Python/ceval.c	Tue Mar 18 02:49:46 2008 +0000
+++ b/Python/ceval.c	Tue Mar 18 03:15:05 2008 +0000
@@ -4086,8 +4086,9 @@
 					if (ret_val == -1)
 						return NULL;
 				}
-				if (Py_Py3kWarningFlag  &&
-				    !Py3kExceptionClass_Check(exc))
+				else if (Py_Py3kWarningFlag  &&
+					 !PyTuple_Check(exc) &&
+					 !Py3kExceptionClass_Check(exc))
 				{
 					int ret_val;
 					ret_val = PyErr_WarnEx(
@@ -4108,8 +4109,9 @@
 				if (ret_val == -1)
 					return NULL;
 			}
-			if (Py_Py3kWarningFlag  &&
-			    !Py3kExceptionClass_Check(w))
+			else if (Py_Py3kWarningFlag  &&
+				 !PyTuple_Check(w) &&
+				 !Py3kExceptionClass_Check(w))
 			{
 				int ret_val;
 				ret_val = PyErr_WarnEx(