From 2043ff3a6b723c7497de9561350a3118f0c096dc Mon Sep 17 00:00:00 2001 From: David Roe Date: Tue, 27 Jun 2017 23:57:11 +0000 Subject: [PATCH] Fixing doctest errors --- src/sage/categories/map.pyx | 4 ++-- src/sage/rings/morphism.pyx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sage/categories/map.pyx b/src/sage/categories/map.pyx index 07caa6d0666..9442b6d7aa3 100644 --- a/src/sage/categories/map.pyx +++ b/src/sage/categories/map.pyx @@ -1895,7 +1895,7 @@ cdef class FormalCompositeMap(Map): # class); therefore, we can not simply call "super" but need to # invoke the category method explicitly return self.getattr_from_category('is_injective')() - except NotImplementedError: + except (AttributeError, NotImplementedError): pass injectives = [] @@ -1961,7 +1961,7 @@ cdef class FormalCompositeMap(Map): # class); therefore, we can not simply call "super" but need to # invoke the category method explicitly return self.getattr_from_category('is_surjective')() - except NotImplementedError: + except (AttributeError, NotImplementedError): pass surjectives = [] diff --git a/src/sage/rings/morphism.pyx b/src/sage/rings/morphism.pyx index 52b3b14e056..52680bf1949 100644 --- a/src/sage/rings/morphism.pyx +++ b/src/sage/rings/morphism.pyx @@ -915,7 +915,7 @@ cdef class RingHomomorphism_coercion(RingHomomorphism): EXAMPLES:: sage: f = ZZ.hom(QQ); f # indirect doctest - Ring Coercion morphism: + Natural morphism: From: Integer Ring To: Rational Field @@ -935,9 +935,9 @@ cdef class RingHomomorphism_coercion(RingHomomorphism): sage: f = ZZ.hom(QQ) sage: type(f) - + sage: f._repr_type() - 'Ring Coercion' + 'Natural' """ return "Ring Coercion" @@ -979,7 +979,7 @@ cdef class RingHomomorphism_coercion(RingHomomorphism): sage: f = ZZ.hom(QQ) sage: type(f) - + sage: hash(f) == hash(f) True sage: {f: 1}[f] @@ -994,7 +994,7 @@ cdef class RingHomomorphism_coercion(RingHomomorphism): EXAMPLES:: sage: f = ZZ.hom(QQ); type(f) - + sage: f(2) == 2 True sage: type(f(2)) # indirect doctest