mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Merge pull request #2573 from GNS3/bugfix/2541
Python 3.14 compatibility
This commit is contained in:
commit
32f48e555c
@ -60,7 +60,14 @@ class FileWatcher:
|
||||
self._hashed[path] = zlib.adler32(open(path, 'rb').read())
|
||||
except OSError:
|
||||
self._hashed[path] = None
|
||||
asyncio.get_event_loop().call_later(self._delay, self._check_config_file_change)
|
||||
|
||||
try:
|
||||
loop = asyncio.get_running_loop()
|
||||
except RuntimeError:
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
|
||||
loop.call_later(self._delay, self._check_config_file_change)
|
||||
|
||||
def __del__(self):
|
||||
self._closed = True
|
||||
|
||||
@ -293,6 +293,11 @@ class WebServer:
|
||||
raise SystemExit
|
||||
self._ssl_context = self._create_ssl_context(server_config)
|
||||
|
||||
try:
|
||||
self._loop = asyncio.get_running_loop()
|
||||
except RuntimeError:
|
||||
self._loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(self._loop)
|
||||
self._loop = asyncio.get_event_loop()
|
||||
|
||||
if log.getEffectiveLevel() == logging.DEBUG:
|
||||
|
||||
@ -53,7 +53,7 @@ def write_config(tmpdir, settings):
|
||||
return path
|
||||
|
||||
|
||||
async def test_get_section_config(tmpdir):
|
||||
def test_get_section_config(tmpdir):
|
||||
|
||||
config = load_config(tmpdir, {
|
||||
"Server": {
|
||||
@ -63,7 +63,7 @@ async def test_get_section_config(tmpdir):
|
||||
assert dict(config.get_section_config("Server")) == {"host": "127.0.0.1"}
|
||||
|
||||
|
||||
async def test_set_section_config(tmpdir):
|
||||
def test_set_section_config(tmpdir):
|
||||
|
||||
config = load_config(tmpdir, {
|
||||
"Server": {
|
||||
@ -77,7 +77,7 @@ async def test_set_section_config(tmpdir):
|
||||
assert dict(config.get_section_config("Server")) == {"host": "192.168.1.1", "local": "true"}
|
||||
|
||||
|
||||
async def test_set(tmpdir):
|
||||
def test_set(tmpdir):
|
||||
|
||||
config = load_config(tmpdir, {
|
||||
"Server": {
|
||||
@ -90,7 +90,7 @@ async def test_set(tmpdir):
|
||||
assert dict(config.get_section_config("Server")) == {"host": "192.168.1.1"}
|
||||
|
||||
|
||||
async def test_reload(tmpdir):
|
||||
def test_reload(tmpdir):
|
||||
|
||||
config = load_config(tmpdir, {
|
||||
"Server": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user