aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-07-01 12:08:11 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-07-01 12:08:11 -0400
commitb07cf871939ce5dfea8e8a145ebca39c95e07439 (patch)
tree997077ac10e5bf5168634de2c5668660e88125f1 /grs/Log.py
parentgrs/Kernel.py: don't fail if kernel image dir exists. (diff)
downloadgrss-b07cf871939ce5dfea8e8a145ebca39c95e07439.tar.gz
grss-b07cf871939ce5dfea8e8a145ebca39c95e07439.tar.bz2
grss-b07cf871939ce5dfea8e8a145ebca39c95e07439.zip
Clean up makedirs().
makedirs() exist_ok=True. Use it to avoid FileExistsError. We are now logging exceptions vi stderr in Daemon.py, so let exceptions propagate up for debugging.
Diffstat (limited to 'grs/Log.py')
-rw-r--r--grs/Log.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/grs/Log.py b/grs/Log.py
index 91141e8..2a7ef9d 100644
--- a/grs/Log.py
+++ b/grs/Log.py
@@ -11,10 +11,7 @@ class Log():
def __init__(self, logfile = CONST.LOGFILE):
self.logfile = logfile
- try:
- os.makedirs(os.path.dirname(self.logfile))
- except FileExistsError:
- pass
+ os.makedirs(os.path.dirname(self.logfile), exist_ok=True)
open(self.logfile, 'a').close()