Commits

Alexey Borzenkov committed c510f32

Make GreenletExit based on BaseException on Python >= 2.5

This way it is more similar to SystemExit and becomes a little
harder to accidentally catch with "except Exception:" statement.

  • Participants
  • Parent commits 2d5b174

Comments (0)

Files changed (1)

 	{
 		INITERROR;
 	}
+#if PY_MAJOR_VERSION >= 3 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 5)
+	PyExc_GreenletExit = PyErr_NewException("greenlet.GreenletExit",
+						PyExc_BaseException, NULL);
+#else
 	PyExc_GreenletExit = PyErr_NewException("greenlet.GreenletExit",
 						NULL, NULL);
+#endif
 	if (PyExc_GreenletExit == NULL)
 	{
 		INITERROR;