Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b05327e commit 6b53b75Copy full SHA for 6b53b75
1 file changed
Lib/test/support/interpreters/__init__.py
@@ -79,13 +79,18 @@ def create():
79
80
def list_all():
81
"""Return all existing interpreters."""
82
+ mainid = _interpreters.get_main()
83
return [Interpreter(id, _owned=owned)
- for id, owned in _interpreters.list_all()]
84
+ for id, owned in _interpreters.list_all()
85
+ if owned or id == mainid]
86
87
88
def get_current():
89
"""Return the currently running interpreter."""
90
id, owned = _interpreters.get_current()
91
+ if not owned and id != _interpreters.get_main():
92
+ # XXX Support this?
93
+ raise InterpreterError('current interpreter was created externally')
94
return Interpreter(id, _owned=owned)
95
96
0 commit comments