From da2b895c9908dc094a0b0c78e99d5e6eee385cfd Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 26 Apr 2015 12:49:29 -0600 Subject: [PATCH] Catch FileNotFoundError exception in os.getcwd() --- gns3server/modules/qemu/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/qemu/__init__.py b/gns3server/modules/qemu/__init__.py index 66a1a968..6dd532ba 100644 --- a/gns3server/modules/qemu/__init__.py +++ b/gns3server/modules/qemu/__init__.py @@ -47,7 +47,11 @@ class Qemu(BaseManager): """ qemus = [] - paths = [os.getcwd()] + paths = [] + try: + paths.append(os.getcwd()) + except FileNotFoundError: + log.warning("The current working directory doesn't exist") if "PATH" in os.environ: paths.extend(os.environ["PATH"].split(os.pathsep)) else: