summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2019-03-26 23:58:19 (GMT)
committerGitHub <noreply@github.com>2019-03-26 23:58:19 (GMT)
commit6a258c88906a7e8acde455ee2acb78b6f315ea0b (patch)
treefcfd1a9f29fff175c92e14a8b6ab1014443a0b00 /Lib/idlelib
parent6da20a49507c46738632baf3e4bfe3bdd086155b (diff)
downloadcpython-6a258c88906a7e8acde455ee2acb78b6f315ea0b.zip
cpython-6a258c88906a7e8acde455ee2acb78b6f315ea0b.tar.gz
cpython-6a258c88906a7e8acde455ee2acb78b6f315ea0b.tar.bz2
bpo-36429: Fix starting IDLE with pyshell (#12548)
Add idlelib.pyshell alias at top; remove pyshell alias at bottom. Remove obsolete __name__=='__main__' command.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/NEWS.txt9
-rwxr-xr-xLib/idlelib/pyshell.py8
2 files changed, 12 insertions, 5 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index dbb3653..be855bc 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -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-36396: Remove fgBg param of idlelib.config.GetHighlight().
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index 11bafdb..2de4265 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -1,6 +1,8 @@
#! /usr/bin/env python3
import sys
+if __name__ == "__main__":
+ sys.modules['idlelib.pyshell'] = sys.modules['__main__']
try:
from tkinter import *
@@ -416,10 +418,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
# run from the IDLE source directory.
del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc',
default=False, type='bool')
- if __name__ == 'idlelib.pyshell':
- command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,)
- else:
- command = "__import__('run').main(%r)" % (del_exitf,)
+ command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,)
return [sys.executable] + w + ["-c", command, str(self.port)]
def start_subprocess(self):
@@ -1574,7 +1573,6 @@ def main():
capture_warnings(False)
if __name__ == "__main__":
- sys.modules['pyshell'] = sys.modules['__main__']
main()
capture_warnings(False) # Make sure turned off; see issue 18081