mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-14 13:28:12 +00:00
Conservative approach to supported versions of Python 3.4 and asyncio.ensure_future, Ref. #1269
This commit is contained in:
@ -20,6 +20,8 @@ import copy
|
||||
import asyncio
|
||||
import asyncio.subprocess
|
||||
|
||||
from gns3server.utils.asyncio import asyncio_ensure_future
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -69,8 +71,8 @@ class AsyncioRawCommandServer:
|
||||
else:
|
||||
replaces.append((replace[0], replace[1], ))
|
||||
|
||||
network_read = asyncio.ensure_future(network_reader.read(READ_SIZE))
|
||||
reader_read = asyncio.ensure_future(process_reader.read(READ_SIZE))
|
||||
network_read = asyncio_ensure_future(network_reader.read(READ_SIZE))
|
||||
reader_read = asyncio_ensure_future(process_reader.read(READ_SIZE))
|
||||
timeout = 30
|
||||
|
||||
while True:
|
||||
@ -89,7 +91,7 @@ class AsyncioRawCommandServer:
|
||||
if network_reader.at_eof():
|
||||
raise ConnectionResetError()
|
||||
|
||||
network_read = asyncio.ensure_future(network_reader.read(READ_SIZE))
|
||||
network_read = asyncio_ensure_future(network_reader.read(READ_SIZE))
|
||||
|
||||
process_writer.write(data)
|
||||
yield from process_writer.drain()
|
||||
@ -97,7 +99,7 @@ class AsyncioRawCommandServer:
|
||||
if process_reader.at_eof():
|
||||
raise ConnectionResetError()
|
||||
|
||||
reader_read = asyncio.ensure_future(process_reader.read(READ_SIZE))
|
||||
reader_read = asyncio_ensure_future(process_reader.read(READ_SIZE))
|
||||
|
||||
for replace in replaces:
|
||||
data = data.replace(replace[0], replace[1])
|
||||
|
Reference in New Issue
Block a user