[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] qapi-types.py: Fail gracefully if out dir is no
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 3/4] qapi-types.py: Fail gracefully if out dir is not specified |
Date: |
Mon, 17 Oct 2011 13:29:36 -0200 |
Otherwise we get:
Traceback (most recent call last):
File "./scripts/qapi-types.py", line 183, in <module>
os.makedirs(output_dir)
File "/usr/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 2] No such file or directory: ''
Signed-off-by: Luiz Capitulino <address@hidden>
---
scripts/qapi-types.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 8df4b72..4a2ddc4 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -178,7 +178,11 @@ if __name__ == '__main__':
prefix = a
elif o in ("-o", "--output-dir"):
output_dir = a
-
+
+ if not output_dir:
+ sys.stdout.write("ouput directory was not specified\n")
+ sys.exit(1)
+
c_file = os.path.join(output_dir, prefix + c_file)
h_file = os.path.join(output_dir, prefix + h_file)
--
1.7.7.rc3