From: Mark Dickinson Date: Sat, 5 Jul 2008 15:25:48 +0000 (+0000) Subject: Minor rewrite of cmath_log to work around a Sun compiler bug. See issue X-Git-Tag: v2.6b2~111 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ecf8d8cc4bc62f7c93c3714b61ff354c37cd5504;p=thirdparty%2FPython%2Fcpython.git Minor rewrite of cmath_log to work around a Sun compiler bug. See issue #3168. --- diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c index 109f2cc9f9f9..42af08cf47b3 100644 --- a/Modules/cmathmodule.c +++ b/Modules/cmathmodule.c @@ -839,8 +839,10 @@ cmath_log(PyObject *self, PyObject *args) errno = 0; PyFPE_START_PROTECT("complex function", return 0) x = c_log(x); - if (PyTuple_GET_SIZE(args) == 2) - x = c_quot(x, c_log(y)); + if (PyTuple_GET_SIZE(args) == 2) { + y = c_log(y); + x = c_quot(x, y); + } PyFPE_END_PROTECT(x) if (errno != 0) return math_error();