From: <pj...@us...> - 2009-10-29 04:26:57
|
Revision: 6928 http://jython.svn.sourceforge.net/jython/?rev=6928&view=rev Author: pjenvey Date: 2009-10-29 04:26:36 +0000 (Thu, 29 Oct 2009) Log Message: ----------- cache the jython check, only apply the ReflectedFunctionType check to jython Modified Paths: -------------- trunk/jython/Lib/inspect.py Modified: trunk/jython/Lib/inspect.py =================================================================== --- trunk/jython/Lib/inspect.py 2009-10-29 02:53:00 UTC (rev 6927) +++ trunk/jython/Lib/inspect.py 2009-10-29 04:26:36 UTC (rev 6928) @@ -30,7 +30,9 @@ import sys, os, types, string, re, dis, imp, tokenize, linecache from operator import attrgetter -ReflectedFunctionType = type(os.listdir) +_jython = sys.platform.startswith('java') +if _jython: + _ReflectedFunctionType = type(os.listdir) # ----------------------------------------------------------- type-checking def ismodule(object): @@ -198,7 +200,7 @@ or isfunction(object) or ismethod(object) or ismethoddescriptor(object) - or isinstance(object, ReflectedFunctionType)) + or (_jython and isinstance(object, _ReflectedFunctionType))) def getmembers(object, predicate=None): """Return all members of an object as (name, value) pairs sorted by name. @@ -690,7 +692,7 @@ if not iscode(co): raise TypeError('arg is not a code object') - if not sys.platform.startswith('java'): + if not _jython: # Jython doesn't have co_code code = co.co_code This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |