Commit cd27844c authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

Revert "script option: fix IndentationError with buildout 2, if some lines are indented."

This reverts the following commits partially:
  d157d8a1
  e92d31cf

With buildout 2, indentation is either fully removed (if anything
starts on the same line as '<option-name> =') or preverved (the same
number of leading spaces if stripped). Any use that required these
commits was a misuse. They could even break valid Python.
parent 9fdccb5d
...@@ -28,7 +28,6 @@ import errno ...@@ -28,7 +28,6 @@ import errno
import logging import logging
import os import os
from platform import uname from platform import uname
import re
import setuptools import setuptools
import shlex import shlex
import shutil import shutil
...@@ -275,9 +274,6 @@ class Script(EnvironMixin): ...@@ -275,9 +274,6 @@ 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'^[ \t]', self.script):
# Buildout 2 keeps all indentation unless all lines have the same indentation.
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:
self.logger.debug('Keeping directories in case of errors') self.logger.debug('Keeping directories in case of errors')
self.keep_on_error = True self.keep_on_error = True
......
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