[gnome-builder] python-gi: ensure GIRepository directory exists before iterating
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] python-gi: ensure GIRepository directory exists before iterating
- Date: Wed, 7 Oct 2015 21:22:04 +0000 (UTC)
commit e6e58c48902a23512e5c079572762acbc932b8b7
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 7 17:21:55 2015 -0400
python-gi: ensure GIRepository directory exists before iterating
.../python_gi_imports_completion.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/plugins/python-gi-imports-completion/python_gi_imports_completion.py
b/plugins/python-gi-imports-completion/python_gi_imports_completion.py
index 03e916a..e5210a0 100644
--- a/plugins/python-gi-imports-completion/python_gi_imports_completion.py
+++ b/plugins/python-gi-imports-completion/python_gi_imports_completion.py
@@ -109,10 +109,11 @@ class CompletionProvider(Ide.Object,
self._libraries_expire_at = now + CACHE_EXPIRE_USEC
for directory in GIRepository.Repository.get_search_path():
- for filename in os.listdir(directory):
- name = filename.split('-')[0]
- if name not in self._libraries:
- self._libraries.append(name)
+ if os.path.exists(directory):
+ for filename in os.listdir(directory):
+ name = filename.split('-')[0]
+ if name not in self._libraries:
+ self._libraries.append(name)
self._libraries.sort()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]