diff --git a/gns3server/controller/gns3vm/__init__.py b/gns3server/controller/gns3vm/__init__.py index bace3022..8c8cd4a7 100644 --- a/gns3server/controller/gns3vm/__init__.py +++ b/gns3server/controller/gns3vm/__init__.py @@ -287,7 +287,7 @@ class GNS3VM: yield from engine.start() except Exception as e: yield from self._controller.delete_compute("vm") - log.error("Can't start the GNS3 VM: {}", str(e)) + log.error("Can't start the GNS3 VM: {}".format(str(e))) yield from compute.update(name="GNS3 VM ({})".format(engine.vmname)) raise e yield from compute.update(name="GNS3 VM ({})".format(engine.vmname), diff --git a/tests/utils.py b/tests/utils.py index abd3f0e3..f1cfd191 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -70,7 +70,10 @@ class AsyncioMagicMock(unittest.mock.MagicMock): """ Magic mock returning coroutine """ - __class__ = types.CoroutineType + try: + __class__ = types.CoroutineType + except AttributeError: # Not supported with Python 3.4 + __class__ = types.GeneratorType def __init__(self, return_value=None, return_values=None, **kwargs): """