diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-23 13:23:48 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-23 13:23:48 -0400 |
| commit | 77e0a5dffe7950a729d6c16afbc70bb867af6dd8 (patch) | |
| tree | 539985ed96c83f5ee7b0f0d3e7d6df63e283620a /lib/sqlalchemy/orm/state.py | |
| parent | 177ad548c458a9f1b8d43378fa8f16e349f80ac3 (diff) | |
| download | sqlalchemy-77e0a5dffe7950a729d6c16afbc70bb867af6dd8.tar.gz | |
Added a conditional to the unpickling process for ORM
mapped objects, such that if the reference to the object
were lost when the object was pickled, we don't
erroneously try to set up _sa_instance_state - fixes
a NoneType error.
Diffstat (limited to 'lib/sqlalchemy/orm/state.py')
| -rw-r--r-- | lib/sqlalchemy/orm/state.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py index 193678c2f..6ade91b3e 100644 --- a/lib/sqlalchemy/orm/state.py +++ b/lib/sqlalchemy/orm/state.py @@ -272,7 +272,8 @@ class InstanceState(interfaces._InspectionAttr): # setup _sa_instance_state ahead of time so that # unpickle events can access the object normally. # see [ticket:2362] - manager.setup_instance(inst, self) + if inst is not None: + manager.setup_instance(inst, self) manager.dispatch.unpickle(self, state) def _initialize(self, key): |
