diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-01-23 02:41:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-01-23 02:41:59 +0000 |
| commit | 75969a81d64df631c81badac6fee5fc9a8e71af5 (patch) | |
| tree | 0e47ec038441ed2adf3ac1dc123220ee4515c5a5 /lib/sqlalchemy | |
| parent | 5675345fc11966d449130ff4e4327a5a4bece0c2 (diff) | |
| parent | f5eeac3d18892206abcaa30a295d12a799a8fb9b (diff) | |
| download | sqlalchemy-75969a81d64df631c81badac6fee5fc9a8e71af5.tar.gz | |
Merge "InstanceState default path is RootRegistry, not tuple"
Diffstat (limited to 'lib/sqlalchemy')
| -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 |
