From fcfff77128174fe5f5e82d2897c5c76df308c8ed Mon Sep 17 00:00:00 2001 From: Pieter Mulder Date: Wed, 29 Jun 2016 11:15:44 -0400 Subject: Repair pickling for Properties object Fixed bug whereby the ``__getstate__`` / ``__setstate__`` methods for sqlalchemy.util.Properties were non-working due to the transition in the 1.0 series to ``__slots__``. The issue potentially impacted some third-party applications. Pull request courtesy Pieter Mulder. Fixes: #3728 Change-Id: I01ebd425bbfe145747fea2edd0d2d412c74fd84d Pull-request: https://github.com/zzzeek/sqlalchemy/pull/286 (cherry picked from commit cab57e9bab04fbdea44690c08dff379a29eaab32) --- lib/sqlalchemy/util/_collections.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py index c29b81f6a..be5d1be44 100644 --- a/lib/sqlalchemy/util/_collections.py +++ b/lib/sqlalchemy/util/_collections.py @@ -200,10 +200,10 @@ class Properties(object): self._data[key] = obj def __getstate__(self): - return {'_data': self.__dict__['_data']} + return {'_data': self._data} def __setstate__(self, state): - self.__dict__['_data'] = state['_data'] + object.__setattr__(self, '_data', state['_data']) def __getattr__(self, key): try: -- cgit v1.2.1