Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Hide unmanaged interpreters.
  • Loading branch information
ericsnowcurrently committed Apr 11, 2024
commit 98fc876ba91f69667c89760693c4abc21f1d144e
7 changes: 6 additions & 1 deletion Lib/test/support/interpreters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ def create():

def list_all():
"""Return all existing interpreters."""
mainid = _interpreters.get_main()
return [Interpreter(id, _owned=owned)
for id, owned in _interpreters.list_all()]
for id, owned in _interpreters.list_all()
if owned or id == mainid]


def get_current():
"""Return the currently running interpreter."""
id, owned = _interpreters.get_current()
if not owned and id != _interpreters.get_main():
# XXX Support this?
raise InterpreterError('current interpreter was created externally')
return Interpreter(id, _owned=owned)


Expand Down