diff --git a/stack/erp5.cfg b/stack/erp5.cfg
index 2f7471dbbd060a8f8b56d31f5d04aacba12af251..f797c292b158f407a72429d6eaf19c7141329b13 100644
--- a/stack/erp5.cfg
+++ b/stack/erp5.cfg
@@ -243,14 +243,16 @@ initialization =
   import Zope2
   os.environ['SOFTWARE_HOME'] = os.path.abspath(os.path.dirname(os.path.dirname(Zope2.__file__)))
   os.environ['ZOPE_SCRIPTS'] = ''
-  temp_bt5_path_list = ['/'.join(['''${buildout:parts-directory}''', x, 'bt5']) for x in '''${erp5_repository_list:repository_id_list}'''.split()]
+  parts_directory = '''${buildout:parts-directory}'''
+  repository_id_list = '''${erp5_repository_list:repository_id_list}'''.split()
+  temp_bt5_path_list = ['/'.join([parts_directory, x, 'bt5']) for x in repository_id_list]
   bt5_path_list = []
   [bt5_path_list.extend([bt5_path, '%s/*' % bt5_path]) for bt5_path in temp_bt5_path_list]
   os.environ['erp5_tests_bt5_path'] = ','.join(bt5_path_list)
-  sys.path[0:0] = ['/'.join(['''${buildout:parts-directory}''', x, 'tests']) for x in '''${erp5_repository_list:repository_id_list}'''.split()]
+  sys.path[0:0] = ['/'.join([parts_directory, x, 'tests']) for x in repository_id_list]
   import glob
   product_test_path_list = []
-  [product_test_path_list.extend(glob.glob('/'.join(['''${buildout:parts-directory}''', x, 'product/*/tests']))) for x in '''${erp5_repository_list:repository_id_list}'''.split()]
+  [product_test_path_list.extend(glob.glob('/'.join([parts_directory, x, 'product/*/tests']))) for x in repository_id_list]
   sys.path[0:0] = product_test_path_list
 
 [test_suite_runner]