annotate Lib/linecache.py @ 39042:c02fa187e0f4 legacy-trunk

Part of SF patch #1484695. This removes dead code. The chksum was already verified in .frombuf() on the lines above. If there was a problem an exception is raised, so there was no way this condition could have been true.
author Neal Norwitz <nnorwitz@gmail.com>
date Mon, 10 Jul 2006 00:23:17 +0000
parents ea3723b2d46b
children 4264cf00a75c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
1 """Cache lines from files.
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
2
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
3 This is intended to read lines from modules imported -- hence if a filename
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
4 is not found, it will look down the module search path for a file by
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
5 that name.
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
6 """
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
722
57e94eba2484 Search through the module search path.
Guido van Rossum <guido@python.org>
parents: 566
diff changeset
8 import sys
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 import os
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
10
29680
4e1a47f5204c Whitespace normalization.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23625
diff changeset
11 __all__ = ["getline", "clearcache", "checkcache"]
16198
32755b456369 a few more modules get __all__
Skip Montanaro <skip@pobox.com>
parents: 15543
diff changeset
12
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
13 def getline(filename, lineno, module_globals=None):
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
14 lines = getlines(filename, module_globals)
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
15 if 1 <= lineno <= len(lines):
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
16 return lines[lineno-1]
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
17 else:
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
18 return ''
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
19
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
20
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 # The cache
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
22
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 cache = {} # The cache
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
24
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
25
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
26 def clearcache():
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
27 """Clear the cache entirely."""
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
28
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
29 global cache
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
30 cache = {}
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
31
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
32
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
33 def getlines(filename, module_globals=None):
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
34 """Get the lines for a file from the cache.
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
35 Update the cache if it doesn't contain an entry for this file already."""
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
36
23620
a1de0bab5475 SF 563203. Replaced 'has_key()' with 'in'.
Raymond Hettinger <python@rcn.com>
parents: 23029
diff changeset
37 if filename in cache:
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
38 return cache[filename][2]
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
39 else:
37594
6dd0d8b4bac5 Adjust whitespace.
Neal Norwitz <nnorwitz@gmail.com>
parents: 37581
diff changeset
40 return updatecache(filename, module_globals)
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
41
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
42
33839
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
43 def checkcache(filename=None):
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
44 """Discard cache entries that are out of date.
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
45 (This is not checked upon each call!)"""
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
46
33839
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
47 if filename is None:
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
48 filenames = cache.keys()
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
49 else:
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
50 if filename in cache:
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
51 filenames = [filename]
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
52 else:
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
53 return
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
54
4dd97c37c2cc SF #737473: Show up-to-date source code in tracebacks always.
Hye-Shik Chang <hyeshik@gmail.com>
parents: 29680
diff changeset
55 for filename in filenames:
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
56 size, mtime, lines, fullname = cache[filename]
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
57 if mtime is None:
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
58 continue # no-op for files loaded via a __loader__
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
59 try:
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
60 stat = os.stat(fullname)
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
61 except os.error:
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
62 del cache[filename]
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
63 continue
23625
65cf478950ff Replaced obsolete stat module constants with equivalent attributes
Raymond Hettinger <python@rcn.com>
parents: 23620
diff changeset
64 if size != stat.st_size or mtime != stat.st_mtime:
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
65 del cache[filename]
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
66
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
67
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
68 def updatecache(filename, module_globals=None):
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
69 """Update a cache entry and return its list of lines.
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
70 If something's wrong, print a message, discard the cache entry,
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
71 and return an empty list."""
566
5a1f9ade1512 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
72
23620
a1de0bab5475 SF 563203. Replaced 'has_key()' with 'in'.
Raymond Hettinger <python@rcn.com>
parents: 23029
diff changeset
73 if filename in cache:
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
74 del cache[filename]
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
75 if not filename or filename[0] + filename[-1] == '<>':
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
76 return []
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
77
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
78 fullname = filename
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
79 try:
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
80 stat = os.stat(fullname)
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
81 except os.error, msg:
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
82 basename = os.path.split(filename)[1]
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
83
37581
b112d8c7988c Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 37576
diff changeset
84 # Try for a __loader__, if available
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
85 if module_globals and '__loader__' in module_globals:
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
86 name = module_globals.get('__name__')
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
87 loader = module_globals['__loader__']
37594
6dd0d8b4bac5 Adjust whitespace.
Neal Norwitz <nnorwitz@gmail.com>
parents: 37581
diff changeset
88 get_source = getattr(loader, 'get_source', None)
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
89
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
90 if name and get_source:
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
91 if basename.startswith(name.split('.')[-1]+'.'):
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
92 try:
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
93 data = get_source(name)
37594
6dd0d8b4bac5 Adjust whitespace.
Neal Norwitz <nnorwitz@gmail.com>
parents: 37581
diff changeset
94 except (ImportError, IOError):
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
95 pass
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
96 else:
38790
ea3723b2d46b Linecache contains support for PEP302 loaders, but fails to deal with loaders
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37594
diff changeset
97 if data is None:
ea3723b2d46b Linecache contains support for PEP302 loaders, but fails to deal with loaders
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37594
diff changeset
98 # No luck, the PEP302 loader cannot find the source
ea3723b2d46b Linecache contains support for PEP302 loaders, but fails to deal with loaders
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37594
diff changeset
99 # for this module.
ea3723b2d46b Linecache contains support for PEP302 loaders, but fails to deal with loaders
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37594
diff changeset
100 return []
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
101 cache[filename] = (
37581
b112d8c7988c Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 37576
diff changeset
102 len(data), None,
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
103 [line+'\n' for line in data.splitlines()], fullname
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
104 )
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
105 return cache[filename][2]
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
106
17977
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
107 # Try looking through the module search path.
37576
d11366f7e1e7 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
Phillip J. Eby <pje@telecommunity.com>
parents: 33839
diff changeset
108
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
109 for dirname in sys.path:
17977
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
110 # When using imputil, sys.path may contain things other than
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
111 # strings; ignore them when it happens.
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
112 try:
17977
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
113 fullname = os.path.join(dirname, basename)
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
114 except (TypeError, AttributeError):
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
115 # Not sufficiently string-like to do anything useful with.
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
116 pass
17977
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
117 else:
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
118 try:
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
119 stat = os.stat(fullname)
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
120 break
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
121 except os.error:
2a94bf235daa Patch from Gordon McMillan.
Tim Peters <tim.peters@gmail.com>
parents: 16198
diff changeset
122 pass
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
123 else:
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
124 # No luck
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
125 ## print '*** Cannot stat', filename, ':', msg
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
126 return []
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
127 try:
23029
8291473fde3e Mass checkin of universal newline support.
Jack Jansen <jack.jansen@cwi.nl>
parents: 17977
diff changeset
128 fp = open(fullname, 'rU')
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
129 lines = fp.readlines()
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
130 fp.close()
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
131 except IOError, msg:
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
132 ## print '*** Cannot open', fullname, ':', msg
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
133 return []
23625
65cf478950ff Replaced obsolete stat module constants with equivalent attributes
Raymond Hettinger <python@rcn.com>
parents: 23620
diff changeset
134 size, mtime = stat.st_size, stat.st_mtime
11706
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
135 cache[filename] = size, mtime, lines, fullname
b6f52c1ef6da More trivial comment -> docstring transformations by Ka-Ping Yee,
Guido van Rossum <guido@python.org>
parents: 2954
diff changeset
136 return lines