Skip to content

Commit

Permalink
Stackless issue python#247: don't expose internal names in module 'st…
Browse files Browse the repository at this point in the history
…ackless'

Module 'stackless' no longer exposes test/internal functions.
  • Loading branch information
Anselm Kruis committed May 9, 2021
1 parent 8e40c40 commit e810a2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
10 changes: 1 addition & 9 deletions Lib/stackless.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

import _stackless
from _stackless import *
# various debugging things starting with underscore
from _stackless import _test_nostacklesscall, _pickle_moduledict, _gc_track, _gc_untrack
try:
from _stackless import _peek # defined if compiled with STACKLESS_SPY
except ImportError: pass
try:
from _stackless import _get_refinfo, _get_all_objects # defined if compiled with Py_TRACE_REFS
except ImportError: pass

def __reduce__():
return "stackless"
Expand Down Expand Up @@ -165,7 +157,7 @@ def pickle_with_tracing_state(self, val):

m = StacklessModuleType("stackless", __doc__)
m.__dict__.update(globals())
del m.transmogrify, m.types, m.sys
del m.transmogrify, m.types, m.sys, m._wrap

# odd curiosity, the stackless module contains a reference to itself
# deprecated, of course
Expand Down
11 changes: 11 additions & 0 deletions Stackless/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ What's New in Stackless 3.X.X?

*Release date: 20XX-XX-XX*

- https://github.com/stackless-dev/stackless/issues/247
The API module 'stackless' used to expose a few debug/internal methods, which
can't be used safely in application code. The following names have been
removed from module 'stackless'. They are still available from 'stackless.
_stackless':
'_gc_track', '_gc_untrack', '_get_all_objects', '_get_refinfo', '_peek',
'_test_nostacklesscall', '_wrap', '_pickle_moduledict'.
The functions 'stackless.test_cframe_nr()' and 'stackless.test_outside()'
have been renamed to 'stackless._stackless._test_cframe_nr()' and 'stackless.
_stackless._test_outside()'

- https://github.com/stackless-dev/stackless/issues/245
Prevent a crash, if you call tasklet.__init__() or tasklet.bind() with wrong
argument types.
Expand Down

0 comments on commit e810a2d

Please sign in to comment.