mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
bpo-36429: Fix starting IDLE with pyshell (#12548)
Add idlelib.pyshell alias at top; remove pyshell alias at bottom. Remove obsolete __name__=='__main__' command.
This commit is contained in:
parent
6da20a4950
commit
6a258c8890
3 changed files with 14 additions and 5 deletions
|
@ -3,6 +3,15 @@ Released on 2019-10-20?
|
||||||
======================================
|
======================================
|
||||||
|
|
||||||
|
|
||||||
|
bpo-36429: Fix starting IDLE with pyshell.
|
||||||
|
Add idlelib.pyshell alias at top; remove pyshell alias at bottom.
|
||||||
|
Remove obsolete __name__=='__main__' command.
|
||||||
|
|
||||||
|
bpo-30348: Increase test coverage of idlelib.autocomplete by 30%.
|
||||||
|
Patch by Louie Lu.
|
||||||
|
|
||||||
|
bpo-23205: Add tests and refactor grep's findfiles.
|
||||||
|
|
||||||
bpo-36405: Use dict unpacking in idlelib.
|
bpo-36405: Use dict unpacking in idlelib.
|
||||||
|
|
||||||
bpo-36396: Remove fgBg param of idlelib.config.GetHighlight().
|
bpo-36396: Remove fgBg param of idlelib.config.GetHighlight().
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#! /usr/bin/env python3
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.modules['idlelib.pyshell'] = sys.modules['__main__']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
|
@ -416,10 +418,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
|
||||||
# run from the IDLE source directory.
|
# run from the IDLE source directory.
|
||||||
del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc',
|
del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc',
|
||||||
default=False, type='bool')
|
default=False, type='bool')
|
||||||
if __name__ == 'idlelib.pyshell':
|
command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,)
|
||||||
command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,)
|
|
||||||
else:
|
|
||||||
command = "__import__('run').main(%r)" % (del_exitf,)
|
|
||||||
return [sys.executable] + w + ["-c", command, str(self.port)]
|
return [sys.executable] + w + ["-c", command, str(self.port)]
|
||||||
|
|
||||||
def start_subprocess(self):
|
def start_subprocess(self):
|
||||||
|
@ -1574,7 +1573,6 @@ def main():
|
||||||
capture_warnings(False)
|
capture_warnings(False)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.modules['pyshell'] = sys.modules['__main__']
|
|
||||||
main()
|
main()
|
||||||
|
|
||||||
capture_warnings(False) # Make sure turned off; see issue 18081
|
capture_warnings(False) # Make sure turned off; see issue 18081
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Fix starting IDLE with pyshell. Add idlelib.pyshell alias at top; remove
|
||||||
|
pyshell alias at bottom. Remove obsolete __name__=='__main__' command.
|
Loading…
Add table
Add a link
Reference in a new issue