bugfix
This commit is contained in:
parent
94b497081c
commit
4cb71227a1
@ -11,21 +11,17 @@ import os
|
||||
from appPublic.log import exception, debug
|
||||
|
||||
async def liner(async_gen):
|
||||
remainer = ''
|
||||
remainer = b''
|
||||
async for chunk in async_gen:
|
||||
chunk = chunk.decode('utf-8')
|
||||
# chunk = chunk.decode('utf-8')
|
||||
d = remainer + chunk
|
||||
lst = d.split('\n', 1)
|
||||
if len(lst) == 2:
|
||||
if lst[0]:
|
||||
yield lst[0]
|
||||
remainer = lst[1]
|
||||
else:
|
||||
remainer = lst[0]
|
||||
for l in remainer.split('\n'):
|
||||
if l:
|
||||
await asyncio.sleep(0)
|
||||
yield l
|
||||
lst = d.split(b'\n')
|
||||
cnt = len(lst)
|
||||
for c in range(cnt-1):
|
||||
yield lst[c]
|
||||
remainer = lst[-1]
|
||||
if remainer != b'':
|
||||
yield remainer
|
||||
|
||||
def get_non_verify_ssl():
|
||||
ssl_context = ssl.create_default_context(cafile=certifi.where())
|
||||
|
Loading…
Reference in New Issue
Block a user