From 7cfe68b96a8a3dd28fc12f18dfdf43f84f1339a0 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 5 Jan 2023 16:55:53 -0800 Subject: [PATCH] beautify remove_quotes function --- jc/parsers/ini.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jc/parsers/ini.py b/jc/parsers/ini.py index 10563db8..003095e9 100644 --- a/jc/parsers/ini.py +++ b/jc/parsers/ini.py @@ -93,15 +93,15 @@ __version__ = info.version def _remove_quotes(value): - if value is not None and value.startswith('"') and value.endswith('"'): - value = value[1:-1] - - elif value is not None and value.startswith("'") and value.endswith("'"): - value = value[1:-1] - - elif value is None: + if value is None: value = '' + elif value.startswith('"') and value.endswith('"'): + value = value[1:-1] + + elif value.startswith("'") and value.endswith("'"): + value = value[1:-1] + return value