mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Python3.8 support. Ref https://github.com/GNS3/gns3-gui/issues/2895
This commit is contained in:
parent
2fd4b2cbc8
commit
a98fc2d308
@ -30,3 +30,4 @@ env:
|
|||||||
- PYTHON_VERSION=3.5
|
- PYTHON_VERSION=3.5
|
||||||
- PYTHON_VERSION=3.6
|
- PYTHON_VERSION=3.6
|
||||||
- PYTHON_VERSION=3.7
|
- PYTHON_VERSION=3.7
|
||||||
|
- PYTHON_VERSION=3.8
|
||||||
|
@ -193,7 +193,7 @@ class ProjectHandler:
|
|||||||
msg = json.dumps({"action": action, "event": msg}, sort_keys=True)
|
msg = json.dumps({"action": action, "event": msg}, sort_keys=True)
|
||||||
log.debug("Send notification: %s", msg)
|
log.debug("Send notification: %s", msg)
|
||||||
await response.write(("{}\n".format(msg)).encode("utf-8"))
|
await response.write(("{}\n".format(msg)).encode("utf-8"))
|
||||||
except asyncio.futures.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
await response.write("{}\n".format(json.dumps(ProjectHandler._getPingMessage())).encode("utf-8"))
|
await response.write("{}\n".format(json.dumps(ProjectHandler._getPingMessage())).encode("utf-8"))
|
||||||
project.stop_listen_queue(queue)
|
project.stop_listen_queue(queue)
|
||||||
if project.id in ProjectHandler._notifications_listening:
|
if project.id in ProjectHandler._notifications_listening:
|
||||||
|
@ -42,7 +42,7 @@ class NotificationQueue(asyncio.Queue):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
(action, msg, kwargs) = await asyncio.wait_for(super().get(), timeout)
|
(action, msg, kwargs) = await asyncio.wait_for(super().get(), timeout)
|
||||||
except asyncio.futures.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
return ("ping", PingStats.get(), {})
|
return ("ping", PingStats.get(), {})
|
||||||
return (action, msg, kwargs)
|
return (action, msg, kwargs)
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from asyncio.futures import CancelledError
|
|
||||||
|
|
||||||
|
|
||||||
async def wait_run_in_executor(func, *args, **kwargs):
|
async def wait_run_in_executor(func, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
@ -56,7 +54,7 @@ async def cancellable_wait_run_in_executor(func, *args, **kwargs):
|
|||||||
kwargs['stopped_event'] = stopped_event
|
kwargs['stopped_event'] = stopped_event
|
||||||
try:
|
try:
|
||||||
await wait_run_in_executor(func, *args, **kwargs)
|
await wait_run_in_executor(func, *args, **kwargs)
|
||||||
except CancelledError:
|
except asyncio.CancelledError:
|
||||||
stopped_event.set()
|
stopped_event.set()
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,13 +20,10 @@ import json
|
|||||||
import urllib
|
import urllib
|
||||||
import asyncio
|
import asyncio
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import logging
|
|
||||||
import traceback
|
import traceback
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import jsonschema.exceptions
|
import jsonschema.exceptions
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
from ..compute.error import NodeError, ImageMissingError
|
from ..compute.error import NodeError, ImageMissingError
|
||||||
from ..controller.controller_error import ControllerError
|
from ..controller.controller_error import ControllerError
|
||||||
from ..ubridge.ubridge_error import UbridgeError
|
from ..ubridge.ubridge_error import UbridgeError
|
||||||
@ -36,6 +33,10 @@ from ..crash_report import CrashReport
|
|||||||
from ..config import Config
|
from ..config import Config
|
||||||
|
|
||||||
|
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def parse_request(request, input_schema, raw):
|
async def parse_request(request, input_schema, raw):
|
||||||
"""Parse body of request and raise HTTP errors in case of problems"""
|
"""Parse body of request and raise HTTP errors in case of problems"""
|
||||||
|
|
||||||
@ -217,7 +218,7 @@ class Route(object):
|
|||||||
response = Response(request=request, route=route)
|
response = Response(request=request, route=route)
|
||||||
response.set_status(409)
|
response.set_status(409)
|
||||||
response.json({"message": str(e), "status": 409, "image": e.image, "exception": e.__class__.__name__})
|
response.json({"message": str(e), "status": 409, "image": e.image, "exception": e.__class__.__name__})
|
||||||
except asyncio.futures.CancelledError:
|
except asyncio.CancelledError:
|
||||||
response = Response(request=request, route=route)
|
response = Response(request=request, route=route)
|
||||||
response.set_status(408)
|
response.set_status(408)
|
||||||
response.json({"message": "Request canceled", "status": 408})
|
response.json({"message": "Request canceled", "status": 408})
|
||||||
|
1
setup.py
1
setup.py
@ -77,6 +77,7 @@ setup(
|
|||||||
"Programming Language :: Python :: 3.5",
|
"Programming Language :: Python :: 3.5",
|
||||||
"Programming Language :: Python :: 3.6",
|
"Programming Language :: Python :: 3.6",
|
||||||
"Programming Language :: Python :: 3.7",
|
"Programming Language :: Python :: 3.7",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: Implementation :: CPython",
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user