Donkyhotay / pgu

Automatically exported from code.google.com/p/pgu
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Error calling isinstance with pygame.Color #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Run examples/gui1.py 

Result:

File "../pgu/gui/theme.py", line 483, in paint
if isinstance(v, pygame.Color) or type(v) == tuple:
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes
and types

pgu 0.12.2
pygame 1.7.1
python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
os: [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2

This was easy for me to fix in my local copy just by removing the
isinstance call since Color is just a function that returns a tuple. I
don't know if there are any backwards compatibility issues to be worried
about with that approach but I've attached a patch of those changes anyway.

Original issue reported on code.google.com by ctcar...@gmail.com on 15 Jun 2009 at 3:31

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the fix - I ran into the same problem but your fix worked for me 
(using
Windows XP, Python 2.5 and Pygame 1.7.1). :)

Original comment by p.witv...@gmail.com on 8 Aug 2009 at 1:40

GoogleCodeExporter commented 9 years ago
I've uploaded a fix to SVN that should take care of this problem (the issue was 
with
pygame versions before 1.8 which handled colors differently).

Original comment by peter.ro...@gmail.com on 11 Aug 2009 at 2:31