From 9a75b10e92dff6cf6dd4f914ce9806c464af1cc0 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 2 Jun 2016 11:50:16 -0700 Subject: [PATCH] Minor cleanups --- Cheetah/SettingsManager.py | 6 +++--- Cheetah/legacy_compiler.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cheetah/SettingsManager.py b/Cheetah/SettingsManager.py index ad0609a1..9ee465c8 100644 --- a/Cheetah/SettingsManager.py +++ b/Cheetah/SettingsManager.py @@ -38,8 +38,8 @@ def updateSettings(self, new_settings): def updateSettingsFromConfigStr(self, config_str): values = [line.split('=', 1) for line in config_str.strip().splitlines()] - settings = dict( - (key.strip(), convert_value(value.strip())) + settings = { + key.strip(): convert_value(value.strip()) for key, value in values - ) + } self.updateSettings(settings) diff --git a/Cheetah/legacy_compiler.py b/Cheetah/legacy_compiler.py index c9be01af..e86e749a 100644 --- a/Cheetah/legacy_compiler.py +++ b/Cheetah/legacy_compiler.py @@ -475,7 +475,7 @@ def addImportedVarNames(self, varNames, raw_statement=None): if not varNames: return if not self.setting('useLegacyImportMode'): - if raw_statement and getattr(self, '_methodBodyChunks'): + if raw_statement and self._methodBodyChunks: self.addChunk(raw_statement) else: self._global_vars.update(varNames)