sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.31k stars 449 forks source link

Fix last string exception for python3 #15951

Closed 3a5ab40a-5e15-47f8-8025-1665d51c0660 closed 10 years ago

3a5ab40a-5e15-47f8-8025-1665d51c0660 commented 10 years ago

sage/algebras/quatalg/quaternion_algebra.py

has in line 988 the (hopefully) last string exception (I found no other):

raise "base field must be rational numbers or number field".

These have been deprecated since long. They not accepted be Python 3.

Component: algebra

Keywords: exception, raise

Author: Wilfried Luebbe

Branch/Commit: 702e08b

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/15951

3a5ab40a-5e15-47f8-8025-1665d51c0660 commented 10 years ago

Branch: u/wluebbe/ticket/15951

3a5ab40a-5e15-47f8-8025-1665d51c0660 commented 10 years ago

Author: Wilfried Luebbe

3a5ab40a-5e15-47f8-8025-1665d51c0660 commented 10 years ago

Commit: 462a495

fchapoton commented 10 years ago
comment:2

Should rather be a ValueError, in my humble opinion

fchapoton commented 10 years ago
comment:3

ok, I have made a branch with ValueError. (plus a few pep8 details around)

If you agree with my branch, you cen set this to positive review


New commits:

702e08btrac #15951 correct one raise statement towards python3
fchapoton commented 10 years ago

Changed commit from 462a495 to 702e08b

fchapoton commented 10 years ago

Reviewer: Frédéric Chapoton

fchapoton commented 10 years ago

Changed branch from u/wluebbe/ticket/15951 to u/chapoton/15951

3a5ab40a-5e15-47f8-8025-1665d51c0660 commented 10 years ago
comment:4

I had selected TypeError after looking at the other raise statements in this module. But ValueError is nearly as good :-)

So the patch is fine for me.

vbraun commented 10 years ago

Changed branch from u/chapoton/15951 to 702e08b