Fernando Perez wrote:
>
> These enormous numbers of calls are the origin of the slowdown, and the more
> modules have been imported, the worse it gets.
--- /exp/lib/python2.5/inspect.py 2006-08-28 11:53:36.000000000 +0200
+++ inspect.py 2006-09-06 12:10:45.000000000 +0200
@@ -444,7 +444,8 @@
in the file and the line number indexes a line in that list. An
IOError
is raised if the source code cannot be retrieved."""
file = getsourcefile(object) or getfile(object)
- module = getmodule(object)
+ #module = getmodule(object)
+ module = None
if module:
lines = linecache.getlines(file, module.__dict__)
else:
The problem seems to originate from the module=getmodule(object) in
findsource. If I outcomment that code (or rather do a module=None),
things seem to be back as normal. (linecache.getlines has been called
with a None module in python 2.4's inspect.py).
- Ralf
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com