Commit e92d31cf authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! script option: fix IndentationError with buildout 2, if some lines are indented.

parent f082a879
...@@ -275,7 +275,7 @@ class Script(EnvironMixin): ...@@ -275,7 +275,7 @@ class Script(EnvironMixin):
if self.script: if self.script:
if self.options.get('format', 'yes') in TRUE_LIST: if self.options.get('format', 'yes') in TRUE_LIST:
self.script = self.script % self.options self.script = self.script % self.options
if re.match(r'^\s', self.script): if re.match(r'^[ \t]', self.script):
# Buildout 2 keeps all indentation unless all lines have the same indentation. # Buildout 2 keeps all indentation unless all lines have the same indentation.
self.script = 'if True:\n' + self.script self.script = 'if True:\n' + self.script
if self.options.get('keep-on-error', '').strip().lower() in TRUE_LIST: if self.options.get('keep-on-error', '').strip().lower() in TRUE_LIST:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment