diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/orm/path_registry.py | 19 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/state.py | 2 |
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 |
