summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-01-23 02:41:59 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-01-23 02:41:59 +0000
commit75969a81d64df631c81badac6fee5fc9a8e71af5 (patch)
tree0e47ec038441ed2adf3ac1dc123220ee4515c5a5 /lib/sqlalchemy
parent5675345fc11966d449130ff4e4327a5a4bece0c2 (diff)
parentf5eeac3d18892206abcaa30a295d12a799a8fb9b (diff)
downloadsqlalchemy-75969a81d64df631c81badac6fee5fc9a8e71af5.tar.gz
Merge "InstanceState default path is RootRegistry, not tuple"
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/path_registry.py19
-rw-r--r--lib/sqlalchemy/orm/state.py2
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/path_registry.py b/lib/sqlalchemy/orm/path_registry.py
index 2c0847426..59ae082bb 100644
--- a/lib/sqlalchemy/orm/path_registry.py
+++ b/lib/sqlalchemy/orm/path_registry.py
@@ -65,7 +65,24 @@ class PathRegistry(HasCacheKey):
]
def __eq__(self, other):
- return other is not None and self.path == other.path
+ try:
+ return other is not None and self.path == other.path
+ except AttributeError:
+ util.warn(
+ "Comparison of PathRegistry to %r is not supported"
+ % (type(other))
+ )
+ return False
+
+ def __ne__(self, other):
+ try:
+ return other is None or self.path != other.path
+ except AttributeError:
+ util.warn(
+ "Comparison of PathRegistry to %r is not supported"
+ % (type(other))
+ )
+ return True
def set(self, attributes, key, value):
log.debug("set '%s' on path '%s' to '%s'", key, self, value)
diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py
index 830b36770..40f8b197e 100644
--- a/lib/sqlalchemy/orm/state.py
+++ b/lib/sqlalchemy/orm/state.py
@@ -62,7 +62,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
key = None
runid = None
load_options = util.EMPTY_SET
- load_path = ()
+ load_path = PathRegistry.root
insert_order = None
_strong_obj = None
modified = False