[gobject-introspection] get_source_root_dirs: handle empty file list case. Fixes #257
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] get_source_root_dirs: handle empty file list case. Fixes #257
- Date: Tue, 8 Jan 2019 09:02:12 +0000 (UTC)
commit 362c656c3152295afd144f3ed551d1eb4ab57445
Author: Christoph Reiter <reiter christoph gmail com>
Date: Tue Jan 8 10:00:05 2019 +0100
get_source_root_dirs: handle empty file list case. Fixes #257
While scannermain checks that at least one filename is given, it filters
them based on the file extension after that, so we still need to handle
an empty file list laster on.
giscanner/scannermain.py | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index 154fe483..b6bbe9d7 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -503,6 +503,9 @@ def get_source_root_dirs(options, filenames):
if not hasattr(os.path, "commonpath"):
return dirs
+ if not dirs:
+ return []
+
common = os.path.commonpath(dirs)
# If the only common path is the root directory give up
if os.path.dirname(common) == common:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]