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

fixup! erp5.util: add support for Python 3

parent a90d4958
......@@ -457,10 +457,9 @@ shared = true
node_test_suite.vcs_repository_list \
if x['repository_path'].endswith("rep0")][0]
# simulate a data corruption on rep0's index
index_file = open(os.path.join(rep0_clone_path, '.git', 'index'), 'a')
index_file.seek(10, os.SEEK_END)
index_file.truncate()
index_file.close()
with open(os.path.join(rep0_clone_path, '.git', 'index'), 'ab') as index_file:
index_file.seek(10, os.SEEK_END)
index_file.truncate()
# we get rev list with corrupted repository, we get None, but in the same
# time the bad repository is deleted
rev_list = self.getAndUpdateFullRevisionList(test_node, node_test_suite)
......
......@@ -171,7 +171,7 @@ shared = true
# only limit to particular error, if we run that code for all errors,
# then if server having most repositories is down for some time, we would
# erase all repositories and facing later hours of downloads
if getattr(error, 'stderr', '').find('index') >= 0:
if getattr(error, 'stderr', b'').find(b'index') >= 0:
rmtree(repository_path)
logger.warning("Error while getting repository, ignoring this test suite",
exc_info=1)
......
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