Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
072248ec
Commit
072248ec
authored
Mar 18, 2015
by
Victor Stinner
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.4 (linecache doc)
parents
58b8f392
376658fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
Doc/library/linecache.rst
Doc/library/linecache.rst
+2
-2
Lib/linecache.py
Lib/linecache.py
+2
-2
No files found.
Doc/library/linecache.rst
View file @
072248ec
...
...
@@ -59,5 +59,5 @@ The :mod:`linecache` module defines the following functions:
Example::
>>> import linecache
>>> linecache.getline(
'/etc/passwd', 4
)
'
sys:x:3:3:sys:/dev:/bin/sh
\n'
>>> linecache.getline(
linecache.__file__, 8
)
'
import sys
\n'
Lib/linecache.py
View file @
072248ec
"""Cache lines from files.
"""Cache lines from
Python source
files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
...
...
@@ -35,7 +35,7 @@ def clearcache():
def
getlines
(
filename
,
module_globals
=
None
):
"""Get the lines for a file from the cache.
"""Get the lines for a
Python source
file from the cache.
Update the cache if it doesn't contain an entry for this file already."""
if
filename
in
cache
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment