summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-12-08 14:13:42 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-12-08 14:13:42 +0100
commit094f4a9622046924032c80768a9760e20f738f80 (patch)
tree1bf94a4ce2dcb2dbb99ad9bd70f5c774f76d5539
parent54c58735472f7a03c0f9370572ce1c778da64bec (diff)
_save_old() code nits
-rw-r--r--kconfiglib.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 7c615e5..fda4d0c 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -5863,11 +5863,9 @@ def _save_old(path):
# See write_config()
dirname, basename = os.path.split(path)
- if basename.startswith("."):
- basename += ".old"
- else:
- basename = "." + basename + ".old"
- backup = os.path.join(dirname, basename)
+ backup = os.path.join(dirname,
+ basename + ".old" if basename.startswith(".") else
+ "." + basename + ".old")
# os.replace() would be nice here, but it's Python 3 (3.3+) only
try: