dib-lint: python3 compatibility fixes
When using up to date distributions for dib development, pep8 installs using python3. This patch fixes the problem, that not the complete dib-lint (which is called) is compatible with python3. Change-Id: I417d03746edb4d34011b997edf8b5b9662ea6f09 Signed-off-by: Andreas Florath <andreas@florath.net>
This commit is contained in:
parent
2978ff885b
commit
7337c9e706
14
bin/dib-lint
14
bin/dib-lint
@ -34,11 +34,15 @@ parse_exclusions() {
|
||||
# ignore = sete setu
|
||||
section="dib-lint"
|
||||
option="ignore"
|
||||
global_exclusions=$(python -c \
|
||||
"import ConfigParser; \
|
||||
conf=ConfigParser.ConfigParser(); \
|
||||
conf.read('tox.ini'); \
|
||||
print conf.get('$section', '$option') if conf.has_option('$section', '$option') else ''"
|
||||
global_exclusions=$(python - <<EOF
|
||||
try:
|
||||
import configparser
|
||||
except ImportError:
|
||||
import ConfigParser as configparser
|
||||
conf=configparser.ConfigParser()
|
||||
conf.read('tox.ini')
|
||||
print(conf.get('$section', '$option')) if conf.has_option('$section', '$option') else ''
|
||||
EOF
|
||||
)
|
||||
echo $exclusions $global_exclusions
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ def main():
|
||||
if use_pypi_python_org:
|
||||
indices.append('https://pypi.python.org/simple')
|
||||
retries = os.environ.get('DIB_PIP_RETRIES')
|
||||
with file(home + '/.pip/pip.conf', 'wt') as output:
|
||||
with open(home + '/.pip/pip.conf', 'wt') as output:
|
||||
output.write('[global]\n')
|
||||
output.write('log = %s/pip.log\n' % (home,))
|
||||
output.write('index-url = %s\n' % (indices[0],))
|
||||
@ -53,7 +53,7 @@ def main():
|
||||
output.write('retries = %s\n' % retries)
|
||||
for index in indices[1:]:
|
||||
output.write('extra-index-url = %s\n' % (index,))
|
||||
with file(home + '/.pydistutils.cfg', 'wt') as output:
|
||||
with open(home + '/.pydistutils.cfg', 'wt') as output:
|
||||
output.write('[easy_install]\n')
|
||||
output.write('index_url = %s\n' % (easy_index,))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user