changeset 10058:440661cc7908

a suite should be registered in the global _suites map at most once
author Doug Simon <doug.simon@oracle.com>
date Sat, 15 Jun 2013 21:05:01 +0200
parents e90e48dae0ab
children 4dada3ec9c58
files mxtool/mx.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Fri Jun 14 19:13:32 2013 +0200
+++ b/mxtool/mx.py	Sat Jun 15 21:05:01 2013 +0200
@@ -608,7 +608,6 @@
     def _post_init(self, opts):
         mxDir = join(self.dir, 'mx')
         self._load_projects(mxDir)
-        _suites[self.name] = self
         for p in self.projects:
             existing = _projects.get(p.name)
             if existing is not None:
@@ -719,10 +718,10 @@
     mxDir = join(d, 'mx')
     if not exists(mxDir) or not isdir(mxDir):
         return None
-    if not _suites.has_key(d):
-        suite = Suite(d, primary)
-        _suites[d] = suite
-        return suite
+    if len([s for s in _suites.itervalues() if s.dir == d]) == 0:
+        s = Suite(d, primary)
+        _suites[s.name] = s
+        return s
 
 def suites():
     """