[gtkmm-documentation/gtkmm-3-24] examples/book/buildapp/step1/install-cmd.py: Minor improvement



commit e2fa3dec29a2092bb9c8f82118f7cd079dbdf607
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Wed Oct 9 18:29:30 2019 +0200

    examples/book/buildapp/step1/install-cmd.py: Minor improvement

 examples/book/buildapp/step1/install-cmd.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/examples/book/buildapp/step1/install-cmd.py b/examples/book/buildapp/step1/install-cmd.py
index 3cb1872..89ad764 100755
--- a/examples/book/buildapp/step1/install-cmd.py
+++ b/examples/book/buildapp/step1/install-cmd.py
@@ -34,11 +34,9 @@ def gschema():
   gschema_file = sys.argv[2]
 
   # Don't do anything, if GSETTINGS_SCHEMA_DIR is not set,
-  # or if it is set to the current directory.
-  if 'GSETTINGS_SCHEMA_DIR' not in os.environ:
-    return 0
-  gschema_install_dir = os.environ['GSETTINGS_SCHEMA_DIR']
-  if not gschema_install_dir or gschema_install_dir == '.':
+  # or if it is set to the current directory ('.').
+  gschema_install_dir = os.environ.get('GSETTINGS_SCHEMA_DIR', None)
+  if not gschema_install_dir or gschema_install_dir == os.curdir:
     return 0
 
   # Create the installation directory, if it does not exist.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]