Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fixing doctest errors
Browse files Browse the repository at this point in the history
  • Loading branch information
roed314 authored and GIT_AUTHOR_NAME committed Jun 27, 2017
1 parent 5c7d1b9 commit 2043ff3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/sage/categories/map.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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 = []
Expand Down
10 changes: 5 additions & 5 deletions src/sage/rings/morphism.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -935,9 +935,9 @@ cdef class RingHomomorphism_coercion(RingHomomorphism):
sage: f = ZZ.hom(QQ)
sage: type(f)
<type 'sage.rings.morphism.RingHomomorphism_coercion'>
<type 'sage.rings.rational.Z_to_Q'>
sage: f._repr_type()
'Ring Coercion'
'Natural'
"""
return "Ring Coercion"

Expand Down Expand Up @@ -979,7 +979,7 @@ cdef class RingHomomorphism_coercion(RingHomomorphism):
sage: f = ZZ.hom(QQ)
sage: type(f)
<type 'sage.rings.morphism.RingHomomorphism_coercion'>
<type 'sage.rings.rational.Z_to_Q'>
sage: hash(f) == hash(f)
True
sage: {f: 1}[f]
Expand All @@ -994,7 +994,7 @@ cdef class RingHomomorphism_coercion(RingHomomorphism):
EXAMPLES::
sage: f = ZZ.hom(QQ); type(f)
<type 'sage.rings.morphism.RingHomomorphism_coercion'>
<type 'sage.rings.rational.Z_to_Q'>
sage: f(2) == 2
True
sage: type(f(2)) # indirect doctest
Expand Down

0 comments on commit 2043ff3

Please sign in to comment.