[Python-checkins] r61478 - python/trunk/Python/ceval.c

guido.van.rossum python-checkins at python.org
Tue Mar 18 04:15:06 CET 2008


Author: guido.van.rossum
Date: Tue Mar 18 04:15:05 2008
New Revision: 61478

Modified:
   python/trunk/Python/ceval.c
Log:
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.


Modified: python/trunk/Python/ceval.c
==============================================================================
--- python/trunk/Python/ceval.c	(original)
+++ python/trunk/Python/ceval.c	Tue Mar 18 04:15:05 2008
@@ -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(


More information about the Python-checkins mailing list