Skip to content

Commit

Permalink
Issue python#128: Fix pickling of the module 'stackless'.
Browse files Browse the repository at this point in the history
Correct the name of the function __reduce_ex__(). And add a test case.

https://bitbucket.org/stackless-dev/stackless/issues/128
(grafted from 7db74e8ee4e77ad617dc5467da0efd3f3b7cf925)
  • Loading branch information
Anselm Kruis committed Apr 14, 2017
1 parent 91712fb commit 2aa8771
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/stackless.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def __reduce__():
return "stackless"
def __reduce_ex_(*args):
def __reduce_ex__(*args):
return "stackless"

# Backwards support for unpickling older pickles, even from 2.7
Expand Down
3 changes: 3 additions & 0 deletions Stackless/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ What's New in Stackless 3.X.X?

*Release date: 20XX-XX-XX*

- https://bitbucket.org/stackless-dev/stackless/issues/128
Fix pickling of the module 'stackless'.

- https://bitbucket.org/stackless-dev/stackless/issues/127
Disable the Stackless specific code for pickling 'iterator' and
'callable_iterator' objects. C-Python 3.3 already pickles them.
Expand Down
4 changes: 4 additions & 0 deletions Stackless/unittests/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,10 @@ def _test(self, obj, *attributes, **kw):
# refer to the same objects
self.assertIs(value_c, value_obj)

def test_module_stackless(self):
# test for issue 128
self.assertIs(stackless, copy.copy(stackless))

def test_code(self):
def f():
pass
Expand Down

0 comments on commit 2aa8771

Please sign in to comment.