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
1ea8cb49
Commit
1ea8cb49
authored
Jan 21, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1726198: replace while 1: fp.readline() with file iteration.
parent
af67f303
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
14 deletions
+4
-14
Lib/formatter.py
Lib/formatter.py
+1
-4
Lib/keyword.py
Lib/keyword.py
+1
-3
Lib/urlparse.py
Lib/urlparse.py
+1
-3
Tools/pynche/ColorDB.py
Tools/pynche/ColorDB.py
+1
-4
No files found.
Lib/formatter.py
View file @
1ea8cb49
...
...
@@ -432,10 +432,7 @@ def test(file = None):
fp
=
open
(
sys
.
argv
[
1
])
else
:
fp
=
sys
.
stdin
while
1
:
line
=
fp
.
readline
()
if
not
line
:
break
for
line
in
fp
:
if
line
==
'
\
n
'
:
f
.
end_paragraph
(
1
)
else
:
...
...
Lib/keyword.py
View file @
1ea8cb49
...
...
@@ -62,9 +62,7 @@ def main():
fp
=
open
(
iptfile
)
strprog
=
re
.
compile
(
'"([^"]+)"'
)
lines
=
[]
while
1
:
line
=
fp
.
readline
()
if
not
line
:
break
for
line
in
fp
:
if
'{1, "'
in
line
:
match
=
strprog
.
search
(
line
)
if
match
:
...
...
Lib/urlparse.py
View file @
1ea8cb49
...
...
@@ -306,9 +306,7 @@ def test():
except
ImportError
:
from
StringIO
import
StringIO
fp
=
StringIO
(
test_input
)
while
1
:
line
=
fp
.
readline
()
if
not
line
:
break
for
line
in
fp
:
words
=
line
.
split
()
if
not
words
:
continue
...
...
Tools/pynche/ColorDB.py
View file @
1ea8cb49
...
...
@@ -50,10 +50,7 @@ class ColorDB:
self
.
__byname
=
{}
# all unique names (non-aliases). built-on demand
self
.
__allnames
=
None
while
1
:
line
=
fp
.
readline
()
if
not
line
:
break
for
line
in
fp
:
# get this compiled regular expression from derived class
mo
=
self
.
_re
.
match
(
line
)
if
not
mo
:
...
...
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