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):
...
@@ -432,10 +432,7 @@ def test(file = None):
fp
=
open
(
sys
.
argv
[
1
])
fp
=
open
(
sys
.
argv
[
1
])
else
:
else
:
fp
=
sys
.
stdin
fp
=
sys
.
stdin
while
1
:
for
line
in
fp
:
line
=
fp
.
readline
()
if
not
line
:
break
if
line
==
'
\
n
'
:
if
line
==
'
\
n
'
:
f
.
end_paragraph
(
1
)
f
.
end_paragraph
(
1
)
else
:
else
:
...
...
Lib/keyword.py
View file @
1ea8cb49
...
@@ -62,9 +62,7 @@ def main():
...
@@ -62,9 +62,7 @@ def main():
fp
=
open
(
iptfile
)
fp
=
open
(
iptfile
)
strprog
=
re
.
compile
(
'"([^"]+)"'
)
strprog
=
re
.
compile
(
'"([^"]+)"'
)
lines
=
[]
lines
=
[]
while
1
:
for
line
in
fp
:
line
=
fp
.
readline
()
if
not
line
:
break
if
'{1, "'
in
line
:
if
'{1, "'
in
line
:
match
=
strprog
.
search
(
line
)
match
=
strprog
.
search
(
line
)
if
match
:
if
match
:
...
...
Lib/urlparse.py
View file @
1ea8cb49
...
@@ -306,9 +306,7 @@ def test():
...
@@ -306,9 +306,7 @@ def test():
except
ImportError
:
except
ImportError
:
from
StringIO
import
StringIO
from
StringIO
import
StringIO
fp
=
StringIO
(
test_input
)
fp
=
StringIO
(
test_input
)
while
1
:
for
line
in
fp
:
line
=
fp
.
readline
()
if
not
line
:
break
words
=
line
.
split
()
words
=
line
.
split
()
if
not
words
:
if
not
words
:
continue
continue
...
...
Tools/pynche/ColorDB.py
View file @
1ea8cb49
...
@@ -50,10 +50,7 @@ class ColorDB:
...
@@ -50,10 +50,7 @@ class ColorDB:
self
.
__byname
=
{}
self
.
__byname
=
{}
# all unique names (non-aliases). built-on demand
# all unique names (non-aliases). built-on demand
self
.
__allnames
=
None
self
.
__allnames
=
None
while
1
:
for
line
in
fp
:
line
=
fp
.
readline
()
if
not
line
:
break
# get this compiled regular expression from derived class
# get this compiled regular expression from derived class
mo
=
self
.
_re
.
match
(
line
)
mo
=
self
.
_re
.
match
(
line
)
if
not
mo
:
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