summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/util.py6
-rw-r--r--test/engine/reflection.py1
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py
index 44ff3a2c5..321540419 100644
--- a/lib/sqlalchemy/util.py
+++ b/lib/sqlalchemy/util.py
@@ -275,10 +275,10 @@ class OrderedProperties(object):
self._data[key] = object
def __getstate__(self):
- return self._data
+ return {'_data': self.__dict__['_data']}
- def __setstate__(self, value):
- self.__dict__['_data'] = value
+ def __setstate__(self, state):
+ self.__dict__['_data'] = state['_data']
def __getattr__(self, key):
try:
diff --git a/test/engine/reflection.py b/test/engine/reflection.py
index 3bb188622..c70dc3f2e 100644
--- a/test/engine/reflection.py
+++ b/test/engine/reflection.py
@@ -372,6 +372,7 @@ class ReflectionTest(PersistTest):
meta.bind = testbase.db
meta2 = pickle.loads(pickle.dumps(meta))
assert meta2.bind is None
+ meta3 = pickle.loads(pickle.dumps(meta2))
return (meta2.tables['mytable'], meta2.tables['othertable'])
def test_pickle_via_reflect():