Opened 10 years ago

Last modified 8 years ago

#12297 new defect

Fix using of options that might not exist

Reported by: kcrisman Owned by: jason, was
Priority: minor Milestone: sage-6.4
Component: graphics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

sage: from sage.plot.polygon import Polygon
sage: G = Graphics()
sage: G.add_primitive(Polygon([1,2,3],[3,2,1],{}))
sage: G
<snip>
/Users/.../sage-4.8.alpha5/local/lib/python2.6/site-packages/sage/plot/polygon.pyc in _render_on_subplot(self, subplot)
    239         options = self.options()
    240         p = patches.Polygon([(self.xdata[i],self.ydata[i]) for i in xrange(len(self.xdata))])
--> 241         p.set_linewidth(float(options['thickness']))
    242         a = float(options['alpha'])
    243         z = int(options.pop('zorder', 1))

KeyError: 'thickness'

Not really important because one isn't normally going to use Polygon empty, but sometimes in other internal code one will use primitives.

Change History (4)

comment:1 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:2 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:3 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:4 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.