A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-September/068661.html below:

[Python-Dev] inspect.py very slow under 2.5

[Python-Dev] inspect.py very slow under 2.5 [Python-Dev] inspect.py very slow under 2.5Ralf Schmitt ralf at brainbot.com
Wed Sep 6 12:14:09 CEST 2006
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

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4