changeset 203:dd1f715398f0

Fixed mapping (dict) values of taskweight
author Oleg Oshmyan <chortos@inbox.lv>
date Wed, 17 Aug 2011 01:32:27 +0300
parents d46bb4495766
children 00c80bba7f13
files upreckon/config.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/upreckon/config.py	Wed Aug 17 01:07:02 2011 +0300
+++ b/upreckon/config.py	Wed Aug 17 01:32:27 2011 +0300
@@ -177,10 +177,11 @@
 		elif not callable(module.tester):
 			tester = tuple(module.tester)
 			module.tester = (nativize_path(tester[0]),) + tester[1:]
-	try:
-		module.taskweight = dict(zip(module.problems, module.taskweight))
-	except TypeError:
-		pass
+	if not isinstance(module.taskweight, dict):
+		try:
+			module.taskweight = dict(zip(module.problems, module.taskweight))
+		except TypeError:
+			pass
 	try:
 		module.taskweight = module.taskweight[problem_name]
 	except KeyError: