[Pygui] Bugs in PyGUI
馬吉軍
jjmmma at gmail.com
Sun Jan 22 06:56:31 CET 2012
Hi,
Sorry that I copied wrong error message. The error in my previous mail is
caused when I'm fixing the code.
Original error is this:
Traceback (most recent call last):
File "C:\Users\CNKIMA\workspace\PyCAN\blobedit.py", line 132, in <module>
BlobApp().run()
File "C:\Python32\lib\site-packages\GUI\GApplications.py", line 144, in
run
self.menus = basic_menus()
File "C:\Python32\lib\site-packages\GUI\StdMenus.py", line 53, in
basic_menus
exclude = exclude)
File "C:\Python32\lib\site-packages\GUI\GStdMenus.py", line 81, in
build_menus
include = include + sum(always_include)
TypeError: unsupported operand type(s) for +: 'set' and 'set'
The reason may be that in Python3.2, + operator is not supported anymore.
So the fix is replace:
include = include + sum(always_include)
with
include = include.intersection(sum(always_include))
BRs, Kimi
顺颂时祺
<http://www.chachafille.com>
On Sun, Jan 22, 2012 at 12:30 PM, David Robinow <drobinow at gmail.com> wrote:
> On Sat, Jan 21, 2012 at 6:56 PM, Greg Ewing <greg.ewing at canterbury.ac.nz>
> wrote:
> > 馬吉軍 wrote:
> >>
> >> I found one small bugs in PyGUI when I run blobedit.py under python 3.2:
> >
> >>
> >>
> >> File "C:\Python32\lib\site-packages\GUI\GStdMenus.py", line 82
> >> include = include + sum(always_include)
> >> ^
> >> TabError: inconsistent use of tabs and spaces in indentation
> >>
> >> *Fix:*
> >> Replace line 81 in C:\Python32\lib\site-packages\GUI\GStdMenus.py:
> >>
> >> #include = include + sum(always_include)
> >> include = include.intersection(sum(always_include))
> >
> >
> > I don't understand this. There doesn't seem to be anything wrong with
> > the indentation around that line in my source, and even if there was,
> > I don't see how the change you suggest would fix it, except by the
> > side effect of changing the whitespace.
> >
> > Is this a bug in Python 3.2? Has anyone else seen this? I don't have
> > a 3.2 installation at hand to test it on, and I'm reluctant to change
> > anything until I understand what's going on better.
> >
> > --
> > Greg
> I think the OP must have caused an indentation error trying to fix the bug.
> I get the following (Vista PyGUI-2.5.3 Python3.2.2)
> Traceback (most recent call last):
> File "blobedit.py", line 132, in <module>
> BlobApp().run()
> File "c:\python32\lib\site-packages\GUI\GApplications.py", line 144, in
> run
> self.menus = basic_menus()
> File "c:\python32\lib\site-packages\GUI\StdMenus.py", line 53, in
> basic_menus
> exclude = exclude)
> File "c:\python32\lib\site-packages\GUI\GStdMenus.py", line 81,in
> build_menus
> include = include + sum(always_include)
> TypeError: unsupported operand type(s) for +: 'set' and 'set'
>
> The demo runs with the proposed fix but it also runs using "union"
> rather than "intersection" which seems more appropriate for the '+'
> operator. But I don't really understand the code very well. Probably
> the correct solution is to make '+' work.
> I haven't tried any fix on Python 2.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pygui/attachments/20120122/c5c26f79/attachment.html>
More information about the Pygui
mailing list