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

Commit

Permalink
Trac #30605: reformat according to pycodestyle.
Browse files Browse the repository at this point in the history
There were a few one-line "if" statements that have now been expanded
to multiple lines.
  • Loading branch information
orlitzky committed Sep 23, 2020
1 parent 09c2fa3 commit 7ea2dd8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/sage/geometry/cone.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,14 +582,18 @@ def _ambient_space_point(body, data):
def try_base_extend(ring):
# Factor out the "try this ring..." code that's repeated four
# times.
try: return L.base_extend(ring)(data)
except TypeError: pass
try:
return L.base_extend(ring)(data)
except TypeError:
pass
except ValueError as ex:
if str(ex).startswith("Cannot coerce"): pass
if str(ex).startswith("Cannot coerce"):
pass

# Special treatment for toric lattice elements
p = try_base_extend(ZZ)
if p is not None: return p
if p is not None:
return p
if is_ToricLattice(parent(data)):
raise TypeError("the point %s and %s have incompatible "
"lattices" % (data, body))
Expand All @@ -599,7 +603,8 @@ def try_base_extend(ring):
# attempt a numerical representation.
for ring in [QQ, AA, RR]:
p = try_base_extend(ring)
if p is not None: return p
if p is not None:
return p

# Raise TypeError with our own message
raise TypeError("%s does not represent a valid point in the ambient "
Expand Down

0 comments on commit 7ea2dd8

Please sign in to comment.