Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
cpython
Commits
faef74a2
Commit
faef74a2
authored
22 years ago
by
Andrew M. Kuchling
Browse files
Options
Download
Email Patches
Plain Diff
Use isinstance() instead of type comparison
parent
79637633
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
Lib/asynchat.py
Lib/asynchat.py
+2
-3
No files found.
Lib/asynchat.py
View file @
faef74a2
...
...
@@ -104,7 +104,7 @@ class async_chat (asyncore.dispatcher):
# no terminator, collect it all
self
.
collect_incoming_data
(
self
.
ac_in_buffer
)
self
.
ac_in_buffer
=
''
elif
typ
e
(
terminator
)
==
type
(
0
):
elif
isinstanc
e
(
terminator
,
int
):
# numeric terminator
n
=
terminator
if
lb
<
n
:
...
...
@@ -183,7 +183,6 @@ class async_chat (asyncore.dispatcher):
# refill the outgoing buffer by calling the more() method
# of the first producer in the queue
def
refill_buffer
(
self
):
_string_type
=
type
(
''
)
while
1
:
if
len
(
self
.
producer_fifo
):
p
=
self
.
producer_fifo
.
first
()
...
...
@@ -194,7 +193,7 @@ class async_chat (asyncore.dispatcher):
self
.
producer_fifo
.
pop
()
self
.
close
()
return
elif
type
(
p
)
is
_string_type
:
elif
isinstance
(
p
,
str
)
:
self
.
producer_fifo
.
pop
()
self
.
ac_out_buffer
=
self
.
ac_out_buffer
+
p
return
...
...
This diff is collapsed.
Click to expand it.
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