Export to GitHub

pgu - issue #5

Error calling isinstance with pygame.Color


Posted on Jun 15, 2009 by Helpful Elephant

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.

Attachments

Comment #1

Posted on Aug 8, 2009 by Grumpy Wombat

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). :)

Comment #2

Posted on Aug 11, 2009 by Swift Camel

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).

Status: Fixed

Labels:
Type-Defect Priority-Medium