Math.sqrt(-1) -- nan or ValueError?

I'm trying to fix a failing unit test in revision 57974. The test in question claims that math.sqrt(-1) should raise ValueError; the code itself gives "nan" as a result for that expression. I can modify the test and therefore have it pass, but I'm not sure if an exception would be more appropriate. I'd be happy for some direction here. Many thanks! -- Cheers, Hasan Diwan <hasan.diwan@gmail.com>

Is this on OSX? That test has been failing (because on that platform sqrt(-1) returns nan instead of raising ValueError) for years -- but the test is only run when run in verbose mode, which mostly hides the issue. Have you read the comment for the test? On 9/4/07, Hasan Diwan <hasan.diwan@gmail.com> wrote:
-- --Guido van Rossum (home page: http://www.python.org/~guido/)

On 04/09/07, Guido van Rossum <guido@python.org> wrote:
Indeed, I am on OSX. Yes, I have read the comment for the test. Would the following pseudocode be an acceptable fix for the problem: if sys.platform == 'darwin' and math.sqrt(-1) == nan: return else: try: x = math.sqrt(-1) except ValueError: pass ... or should I just not bother? -- Cheers, Hasan Diwan <hasan.diwan@gmail.com>

I think it's better for the test to fail, to indicate that there's an unresolved problem on the platform. On 9/4/07, Hasan Diwan <hasan.diwan@gmail.com> wrote:
-- --Guido van Rossum (home page: http://www.python.org/~guido/)

Is this on OSX? That test has been failing (because on that platform sqrt(-1) returns nan instead of raising ValueError) for years -- but the test is only run when run in verbose mode, which mostly hides the issue. Have you read the comment for the test? On 9/4/07, Hasan Diwan <hasan.diwan@gmail.com> wrote:
-- --Guido van Rossum (home page: http://www.python.org/~guido/)

On 04/09/07, Guido van Rossum <guido@python.org> wrote:
Indeed, I am on OSX. Yes, I have read the comment for the test. Would the following pseudocode be an acceptable fix for the problem: if sys.platform == 'darwin' and math.sqrt(-1) == nan: return else: try: x = math.sqrt(-1) except ValueError: pass ... or should I just not bother? -- Cheers, Hasan Diwan <hasan.diwan@gmail.com>

I think it's better for the test to fail, to indicate that there's an unresolved problem on the platform. On 9/4/07, Hasan Diwan <hasan.diwan@gmail.com> wrote:
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (2)
-
Guido van Rossum
-
Hasan Diwan