diff options
author | Ned Deily <nad@acm.org> | 2013-12-11 00:32:57 (GMT) |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2013-12-11 00:32:57 (GMT) |
commit | e72b90eb7ac997e62f547d4ab56a68fe21206e87 (patch) | |
tree | 67e42a2e25ea99749755a359fca7db27f254ab6e /Lib/idlelib | |
parent | 7f7f3d7879c0e087101a969060e5dc0505ec270b (diff) | |
parent | f3c6589ea3890d10d6774ec7699a419313a6fb0f (diff) | |
download | cpython-e72b90eb7ac997e62f547d4ab56a68fe21206e87.zip cpython-e72b90eb7ac997e62f547d4ab56a68fe21206e87.tar.gz cpython-e72b90eb7ac997e62f547d4ab56a68fe21206e87.tar.bz2 |
Issue #18270: merge from 3.3
Diffstat (limited to 'Lib/idlelib')
-rwxr-xr-x[-rw-r--r--] | Lib/idlelib/PyShell.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 176170f..3c203d0 100644..100755 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1540,20 +1540,22 @@ def main(): args.remove(filename) if not args: flist.new() + if enable_shell: shell = flist.open_shell() if not shell: return # couldn't open shell - if macosxSupport.runningAsOSXApp() and flist.dict: # On OSX: when the user has double-clicked on a file that causes # IDLE to be launched the shell window will open just in front of # the file she wants to see. Lower the interpreter window when # there are open files. shell.top.lower() + else: + shell = flist.pyshell - shell = flist.pyshell - # handle remaining options: + # Handle remaining options. If any of these are set, enable_shell + # was set also, so shell must be true to reach here. if debug: shell.open_debugger() if startup: @@ -1561,7 +1563,7 @@ def main(): os.environ.get("PYTHONSTARTUP") if filename and os.path.isfile(filename): shell.interp.execfile(filename) - if shell and cmd or script: + if cmd or script: shell.interp.runcommand("""if 1: import sys as _sys _sys.argv = %r @@ -1572,13 +1574,14 @@ def main(): elif script: shell.interp.prepend_syspath(script) shell.interp.execfile(script) - - # Check for problematic OS X Tk versions and print a warning message - # in the IDLE shell window; this is less intrusive than always opening - # a separate window. - tkversionwarning = macosxSupport.tkVersionWarning(root) - if tkversionwarning: - shell.interp.runcommand(''.join(("print('", tkversionwarning, "')"))) + elif shell: + # If there is a shell window and no cmd or script in progress, + # check for problematic OS X Tk versions and print a warning + # message in the IDLE shell window; this is less intrusive + # than always opening a separate window. + tkversionwarning = macosxSupport.tkVersionWarning(root) + if tkversionwarning: + shell.interp.runcommand("print('%s')" % tkversionwarning) while flist.inversedict: # keep IDLE running while files are open. root.mainloop() |