summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2019-01-08 10:00:05 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2019-01-08 10:00:05 +0100
commit362c656c3152295afd144f3ed551d1eb4ab57445 (patch)
tree4cc8e79445ae725d5e52270fa42fabb4d75cbbb9 /giscanner
parentb788f975b3ca7f092cb906c66722326fac43c281 (diff)
downloadgobject-introspection-362c656c3152295afd144f3ed551d1eb4ab57445.tar.gz
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.
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/scannermain.py3
1 files changed, 3 insertions, 0 deletions
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: