summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/unitofwork.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/orm/unitofwork.py')
-rw-r--r--lib/sqlalchemy/orm/unitofwork.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py
index 2964705a2..3ef2b2edf 100644
--- a/lib/sqlalchemy/orm/unitofwork.py
+++ b/lib/sqlalchemy/orm/unitofwork.py
@@ -86,9 +86,8 @@ def track_cascade_events(descriptor, prop):
not sess._contains_state(newvalue_state):
sess._save_or_update_state(newvalue_state)
- if oldvalue is not None and \
- oldvalue is not attributes.PASSIVE_NO_RESULT and \
- prop._cascade.delete_orphan:
+ if oldvalue not in orm_util._none_tuple and \
+ prop._cascade.delete_orphan:
# possible to reach here with attributes.NEVER_SET ?
oldvalue_state = attributes.instance_state(oldvalue)