In my application I had a problem with self referencial mappers.
Currently I can not reproduce it in a simple example but the attached
diff solved the problem.

I got an error because task.dependencies was changed inside the while loop.

I also tested the change against the tests in sqlalchemy.test.
Apart from the existing errors when running the test there was no new
error introduced.


Jürgen

-- 

---------------------------------------------------
Jürgen Kartnaller   mailto:juergen_at_kartnaller.at
                    http://www.kartnaller.at
                    http://www.mcb-bregenz.at
                    irc : jukart
---------------------------------------------------

Index: unitofwork.py
===================================================================
--- unitofwork.py       (Revision 1518)
+++ unitofwork.py       (Arbeitskopie)
@@ -735,7 +735,8 @@
         # organize all original UOWDependencyProcessors by their target task
         deps_by_targettask = {}
         for task in cycles:
-            for dep in task.dependencies:
+            deps = list(task.dependencies)
+            for dep in deps:
                 if dep.targettask not in cycles or 
trans.get_task_by_mapper(dep.processor.mapper) not in cycles:
                     extradeplist.append(dep)
                 l = deps_by_targettask.setdefault(dep.targettask, [])

Reply via email to