[gnome-tweak-tool] utils: Switch to os.makedirs exist_ok=True



commit 1ae226a2d8b1394dccd20030dcd2619f95056dc9
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Tue Jun 6 18:10:37 2017 -0400

    utils: Switch to os.makedirs exist_ok=True
    
    Requires Python 3.2

 gtweak/utils.py |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/gtweak/utils.py b/gtweak/utils.py
index 64b07aa..7c905a5 100644
--- a/gtweak/utils.py
+++ b/gtweak/utils.py
@@ -157,11 +157,7 @@ class AutostartFile:
             self._extra_exec_args = "\n"
 
         user_autostart_dir = os.path.join(GLib.get_user_config_dir(), "autostart")
-        if not os.path.isdir(user_autostart_dir):
-            try:
-                os.makedirs(user_autostart_dir)
-            except:
-                logging.critical("Could not create autostart dir: %s" % user_autostart_dir)
+        os.makedirs(user_autostart_dir, exist_ok=True)
 
         self._user_autostart_file = os.path.join(user_autostart_dir, self._autostart_desktop_filename)
 


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