kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #40870
Re: PATCH: fix crash in netlist updater
On a related note, python api to get drawings (and probably everything else
that is now in deque) is broken.
board.GetDrawings() returns
<pcbnew.DRAWINGS; proxy of <Swig Object of type 'std::deque< BOARD_ITEM * >
*' at 0x7fa121ffc930> >
and it's items don't have some methods for some reason
b = pcbnew.GetBoard()
d = b.GetDrawings()
d[0].GetClass()
'DRAWSEGMENT'
d[0].GetShape()
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/pcbnew.py", line 8393, in
<lambda>
__getattr__ = lambda self, name: _swig_getattr(self, BOARD_ITEM, name)
File "/usr/local/lib/python3.6/dist-packages/pcbnew.py", line 83, in
_swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" %
(class_type.__name__, name))
AttributeError: 'BOARD_ITEM' object has no attribute 'GetShape'
On Sat, Jun 1, 2019 at 9:49 PM Seth Hillbrand <seth@xxxxxxxxxxxxx> wrote:
>
> Thanks Andrew! Good catch.
>
> -Seth
>
> On 2019-06-01 21:40, Andrew Lutsenko wrote:
> > Hi Seth,
> >
> > I tried to pull netlist into completely empty board today and got a
> > crash that I tracked down to
> > this commit
> >
> https://github.com/KiCad/kicad-source-mirror/commit/d1877d7c1b531dee2f4e35304a1d6b33a34c5fff
> >
> > Simple fix for this particular problem is in attached patch but I
> > didn't go through all the changes in that commit. It seems in a few
> > places there are unchecked Modules().front() calls. Maybe they should
> > be changed to GetFirstModule().
> >
> > Regards,
> > Andrew
>
Follow ups
References