remove ambiguous except blocks

security-update
Andrew Port 2021-09-21 02:49:00 -07:00
parent 413a2864f6
commit e71d2d4282
1 changed files with 6 additions and 13 deletions

View File

@ -141,14 +141,11 @@ def split_bezier(bpoints, t):
def halve_bezier(p): def halve_bezier(p):
"""split path segment into two halves at t=0.5"""
# begin arc support block ######################## # for Arc support
try: if hasattr(p, 'radius'):
p.large_arc
return p.split(0.5) return p.split(0.5)
except:
pass
# end arc support block ##########################
if len(p) == 4: if len(p) == 4:
return ([p[0], (p[0] + p[1])/2, (p[0] + 2*p[1] + p[2])/4, return ([p[0], (p[0] + p[1])/2, (p[0] + 2*p[1] + p[2])/4,
@ -195,13 +192,9 @@ def bezier_bounding_box(bez):
(xmin, xmax, ymin, ymax). (xmin, xmax, ymin, ymax).
Warning: For the non-cubic case this is not particularly efficient.""" Warning: For the non-cubic case this is not particularly efficient."""
# begin arc support block ######################## # for Arc support
try: if hasattr(bez, 'radius'):
bla = bez.large_arc return bez.bbox()
return bez.bbox() # added to support Arc objects
except:
pass
# end arc support block ##########################
if len(bez) == 4: if len(bez) == 4:
xmin, xmax = bezier_real_minmax([p.real for p in bez]) xmin, xmax = bezier_real_minmax([p.real for p in bez])