File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949import asyncore
5050from collections import deque
5151
52- def buffer (obj , start = None , stop = None ):
53- # if memoryview objects gain slicing semantics,
54- # this function will change for the better
55- # memoryview used for the TypeError
56- memoryview (obj )
57- if start == None :
58- start = 0
59- if stop == None :
60- stop = len (obj )
61- x = obj [start :stop ]
62- ## print("buffer type is: %s"%(type(x),))
63- return x
6452
6553class async_chat (asyncore .dispatcher ):
6654 """This is an abstract class. You must derive from this class, and add
@@ -240,7 +228,7 @@ def initiate_send(self):
240228 # handle classic producer behavior
241229 obs = self .ac_out_buffer_size
242230 try :
243- data = buffer ( first , 0 , obs )
231+ data = first [: obs ]
244232 except TypeError :
245233 data = first .more ()
246234 if data :
You can’t perform that action at this time.
0 commit comments