From ebe930a5f8d1e32d99854930e72821ce75b21906 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 Apr 2022 08:10:48 +0200 Subject: [PATCH] keep old type error at initialization --- src/sage/geometry/polyhedron/backend_ppl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/geometry/polyhedron/backend_ppl.py b/src/sage/geometry/polyhedron/backend_ppl.py index 6ac7a21ce65..3a5b7aa94b6 100644 --- a/src/sage/geometry/polyhedron/backend_ppl.py +++ b/src/sage/geometry/polyhedron/backend_ppl.py @@ -189,13 +189,13 @@ def set_immutable(self): sage: smaller_cube_ZZ.set_immutable() Traceback (most recent call last): ... - TypeError: the polyhedron is not integral; do a base extension ``self.base_extend(QQ)`` + TypeError: no conversion of this rational to integer sage: smaller_cube_ZZ.is_immutable() False sage: smaller_cube_ZZ.set_immutable() Traceback (most recent call last): ... - TypeError: the polyhedron is not integral; do a base extension ``self.base_extend(QQ)`` + TypeError: no conversion of this rational to integer sage: smaller_cube_ZZ.is_immutable() False sage: smaller_cube_QQ = smaller_cube_ZZ.base_extend(QQ) @@ -206,10 +206,10 @@ def set_immutable(self): if not hasattr(self, '_Vrepresentation'): try: self._init_Vrepresentation_from_ppl(True) - except TypeError: + except TypeError as e: # Apparently the polyhedron is (no longer) integral. self._clear_cache() - raise TypeError("the polyhedron is not integral; do a base extension ``self.base_extend(QQ)``") + raise e if not hasattr(self, '_Hrepresentation'): self._init_Hrepresentation_from_ppl(True) self._is_mutable = False