Open GoogleCodeExporter opened 8 years ago
Wow this is old code. So the issue isn't imports or paths or modules. The
problem is the code doesn't
understand new style class (e.g. class foo(object) vs. class foo()) which I
think started in python 2.2??
Also there are some new PyRex helpers that are useful.
Here's the fix:
around line 746:
{{{
def js_classname(pobj):
# class or instance?
if inspect.isclass(pobj):
klass = pobj
else:
klass = pobj.__class__
}}}
or in patch form:
{{{
Index: spidermonkey.pyx
===================================================================
--- spidermonkey.pyx (revision 29)
+++ spidermonkey.pyx (working copy)
@@ -745,10 +745,10 @@
def js_classname(pobj):
# class or instance?
- try:
+ if inspect.isclass(pobj):
+ klass = pobj
+ else:
klass = pobj.__class__
- except AttributeError:
- klass = pobj
try:
name = klass.js_name
}}}
You'll want to update the test to have a few new style classes too. Not sure
how you want to do this, so I
punted.
Original comment by nickgsup...@gmail.com
on 28 Oct 2008 at 5:11
Original issue reported on code.google.com by
nickgsup...@gmail.com
on 28 Oct 2008 at 3:04