#7535 Errors should be raised, not returned.
diff -r 7ad9673fabcf sage/geometry/polyhedra.py
|
a
|
b
|
|
| 1065 | 1065 | """ |
| 1066 | 1066 | if self.dim() > 4: |
| 1067 | 1067 | print "Dimension is too large for wireframe" |
| 1068 | | return NotImplementedError |
| | 1068 | raise NotImplementedError |
| 1069 | 1069 | if self.dim() < 4: |
| 1070 | 1070 | if self.ieqs() == self.vertices() == []: |
| 1071 | 1071 | return Graphics() |
diff -r 7ad9673fabcf sage/groups/perm_gps/permgroup_named.py
|
a
|
b
|
|
| 964 | 964 | not a (smallish) "Hurwitz prime", an error message will be printed. |
| 965 | 965 | """ |
| 966 | 966 | if self.matrix_degree()!=2: |
| 967 | | return ValueError, "Degree must be 2." |
| | 967 | raise ValueError("Degree must be 2.") |
| 968 | 968 | F = self.base_ring() |
| 969 | 969 | q = F.order() |
| 970 | 970 | from sage.misc.misc import SAGE_EXTCODE |
| … |
… |
|
| 1007 | 1007 | randomness to the ordering of the characters. |
| 1008 | 1008 | """ |
| 1009 | 1009 | if self.matrix_degree()!=2: |
| 1010 | | return ValueError, "Degree must be 2." |
| | 1010 | raise ValueError("Degree must be 2.") |
| 1011 | 1011 | F = self.base_ring() |
| 1012 | 1012 | q = F.order() |
| 1013 | 1013 | from sage.misc.misc import SAGE_EXTCODE |
diff -r 7ad9673fabcf sage/interfaces/gap.py
|
a
|
b
|
|
| 574 | 574 | E = self._expect |
| 575 | 575 | try: |
| 576 | 576 | if len(line) > 4095: |
| 577 | | raise RuntimeError,"Passing commands this long to gap would hang" |
| | 577 | raise RuntimeError("Passing commands this long to gap would hang") |
| 578 | 578 | E.sendline(line) |
| 579 | 579 | except OSError: |
| 580 | | return RuntimeError, "Error evaluating %s in %s"%(line, self) |
| | 580 | raise RuntimeError("Error evaluating %s in %s"%(line, self)) |
| 581 | 581 | if wait_for_prompt == False: |
| 582 | 582 | return ('','') |
| 583 | 583 | if len(line)==0: |
| … |
… |
|
| 629 | 629 | pass # there is no need to do anything |
| 630 | 630 | except pexpect.EOF: |
| 631 | 631 | if not expect_eof: |
| 632 | | raise RuntimeError, "Unexpected EOF from %s executing %s"%(self,line) |
| | 632 | raise RuntimeError("Unexpected EOF from %s executing %s"%(self,line)) |
| 633 | 633 | except IOError: |
| 634 | | raise RuntimeError, "IO Error from %s executing %s"%(self,line) |
| | 634 | raise RuntimeError("IO Error from %s executing %s"%(self,line)) |
| 635 | 635 | return ("".join(normal_outputs),"".join(error_outputs)) |
| 636 | 636 | |
| 637 | 637 | def _keyboard_interrupt(self): |
diff -r 7ad9673fabcf sage/modular/abvar/finite_subgroup.py
|
a
|
b
|
|
| 277 | 277 | A = self.abelian_variety() |
| 278 | 278 | B = other.abelian_variety() |
| 279 | 279 | if not A.in_same_ambient_variety(B): |
| 280 | | return ValueError, "self and other must be in the same ambient Jacobian" |
| | 280 | raise ValueError("self and other must be in the same ambient Jacobian") |
| 281 | 281 | K = composite_field(self.field_of_definition(), other.field_of_definition()) |
| 282 | 282 | lattice = self.lattice() + other.lattice() |
| 283 | 283 | if A != B: |
diff -r 7ad9673fabcf sage/modular/arithgroup/congroup_gammaH.py
|
a
|
b
|
|
| 937 | 937 | |
| 938 | 938 | from all import is_Gamma0, is_Gamma1 |
| 939 | 939 | if not isinstance(other, GammaH_class): |
| 940 | | return NotImplementedError |
| | 940 | raise NotImplementedError |
| 941 | 941 | |
| 942 | 942 | # level of self should divide level of other |
| 943 | 943 | if self.level() % other.level(): |
diff -r 7ad9673fabcf sage/rings/finite_field_element.py
|
a
|
b
|
|
| 381 | 381 | return self.__multiplicative_order |
| 382 | 382 | except AttributeError: |
| 383 | 383 | if self.is_zero(): |
| 384 | | return ArithmeticError, "Multiplicative order of 0 not defined." |
| | 384 | raise ArithmeticError("Multiplicative order of 0 not defined.") |
| 385 | 385 | n = self.parent().order() - 1 |
| 386 | 386 | order = 1 |
| 387 | 387 | for p, e in arith.factor(n): |
diff -r 7ad9673fabcf sage/rings/finite_field_givaro.pyx
|
a
|
b
|
|
| 1953 | 1953 | return self.__multiplicative_order |
| 1954 | 1954 | else: |
| 1955 | 1955 | if self.is_zero(): |
| 1956 | | return ArithmeticError, "Multiplicative order of 0 not defined." |
| | 1956 | raise ArithmeticError("Multiplicative order of 0 not defined.") |
| 1957 | 1957 | n = (parent_object(self)).order_c() - 1 |
| 1958 | 1958 | order = 1 |
| 1959 | 1959 | for p, e in sage.rings.arith.factor(n): |
diff -r 7ad9673fabcf sage/schemes/elliptic_curves/ell_curve_isogeny.py
|
a
|
b
|
|
| 3990 | 3990 | j = QQ(j) |
| 3991 | 3991 | if l != None: |
| 3992 | 3992 | if not l.is_prime(): |
| 3993 | | return ValueError, "%s is not prime."%l |
| | 3993 | raise ValueError("%s is not prime."%l) |
| 3994 | 3994 | if not isog_table.has_key((l,j)): |
| 3995 | 3995 | return [] |
| 3996 | 3996 | Ew = E.short_weierstrass_model() |
diff -r 7ad9673fabcf sage/symbolic/expression_conversions.py
|
a
|
b
|
|
| 638 | 638 | if f_sympy: |
| 639 | 639 | return f_sympy(*sympy.sympify(g)) |
| 640 | 640 | else: |
| 641 | | return NotImplementedError("SymPy function '%s' doesn't exist" % f) |
| | 641 | raise NotImplementedError("SymPy function '%s' doesn't exist" % f) |
| 642 | 642 | |
| 643 | 643 | sympy = SympyConverter() |
| 644 | 644 | |