Compare commits
3 Commits
8a62887dfb
...
212337369a
Author | SHA1 | Date |
---|---|---|
Ned Deily | 212337369a | |
Terry Jan Reedy | 57e5113610 | |
Raymond Hettinger | 752cdf21eb |
|
@ -696,7 +696,7 @@ The add_argument() method
|
|||
* const_ - A constant value required by some action_ and nargs_ selections.
|
||||
|
||||
* default_ - The value produced if the argument is absent from the
|
||||
command line.
|
||||
command line and if it is absent from the namespace object.
|
||||
|
||||
* type_ - The type to which the command-line argument should be converted.
|
||||
|
||||
|
@ -1006,6 +1006,14 @@ was not present at the command line::
|
|||
>>> parser.parse_args([])
|
||||
Namespace(foo=42)
|
||||
|
||||
If the target namespace already has an attribute set, the action *default*
|
||||
will not over write it::
|
||||
|
||||
>>> parser = argparse.ArgumentParser()
|
||||
>>> parser.add_argument('--foo', default=42)
|
||||
>>> parser.parse_args([], namespace=argparse.Namespace(foo=101))
|
||||
Namespace(foo=101)
|
||||
|
||||
If the ``default`` value is a string, the parser parses the value as if it
|
||||
were a command-line argument. In particular, the parser applies any type_
|
||||
conversion argument, if provided, before setting the attribute on the
|
||||
|
|
|
@ -3,6 +3,10 @@ Released on 2021-10-04?
|
|||
======================================
|
||||
|
||||
|
||||
bpo-42508: Keep IDLE running on macOS. Remove obsolete workaround
|
||||
that prevented running files with shortcuts when using new universal2
|
||||
installers built on macOS 11.
|
||||
|
||||
bpo-42426: Fix reporting offset of the RE error in searchengine.
|
||||
|
||||
bpo-42416: Get docstrings for IDLE calltips more often
|
||||
|
|
|
@ -11,6 +11,7 @@ TODO: Specify command line arguments in a dialog box.
|
|||
"""
|
||||
import os
|
||||
import tabnanny
|
||||
import time
|
||||
import tokenize
|
||||
|
||||
import tkinter.messagebox as tkMessageBox
|
||||
|
@ -42,9 +43,7 @@ class ScriptBinding:
|
|||
self.root = self.editwin.root
|
||||
# cli_args is list of strings that extends sys.argv
|
||||
self.cli_args = []
|
||||
|
||||
if macosx.isCocoaTk():
|
||||
self.editwin.text_frame.bind('<<run-module-event-2>>', self._run_module_event)
|
||||
self.perf = 0.0 # Workaround for macOS 11 Uni2; see bpo-42508.
|
||||
|
||||
def check_module_event(self, event):
|
||||
if isinstance(self.editwin, outwin.OutputWindow):
|
||||
|
@ -107,24 +106,10 @@ class ScriptBinding:
|
|||
finally:
|
||||
shell.set_warning_stream(saved_stream)
|
||||
|
||||
def run_module_event(self, event):
|
||||
if macosx.isCocoaTk():
|
||||
# Tk-Cocoa in MacOSX is broken until at least
|
||||
# Tk 8.5.9, and without this rather
|
||||
# crude workaround IDLE would hang when a user
|
||||
# tries to run a module using the keyboard shortcut
|
||||
# (the menu item works fine).
|
||||
self.editwin.text_frame.after(200,
|
||||
lambda: self.editwin.text_frame.event_generate(
|
||||
'<<run-module-event-2>>'))
|
||||
return 'break'
|
||||
else:
|
||||
return self._run_module_event(event)
|
||||
|
||||
def run_custom_event(self, event):
|
||||
return self._run_module_event(event, customize=True)
|
||||
return self.run_module_event(event, customize=True)
|
||||
|
||||
def _run_module_event(self, event, *, customize=False):
|
||||
def run_module_event(self, event, *, customize=False):
|
||||
"""Run the module after setting up the environment.
|
||||
|
||||
First check the syntax. Next get customization. If OK, make
|
||||
|
@ -133,6 +118,8 @@ class ScriptBinding:
|
|||
module being executed and also add that directory to its
|
||||
sys.path if not already included.
|
||||
"""
|
||||
if macosx.isCocoaTk() and (time.perf_counter() - self.perf < .05):
|
||||
return 'break'
|
||||
if isinstance(self.editwin, outwin.OutputWindow):
|
||||
self.editwin.text.bell()
|
||||
return 'break'
|
||||
|
@ -218,6 +205,7 @@ class ScriptBinding:
|
|||
# XXX This should really be a function of EditorWindow...
|
||||
tkMessageBox.showerror(title, message, parent=self.editwin.text)
|
||||
self.editwin.text.focus_set()
|
||||
self.perf = time.perf_counter()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
\f3\fmodern\fcharset0 CourierNewPSMT;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\expandedcolortbl;;}
|
||||
\margl1440\margr1440\vieww13380\viewh14600\viewkind0
|
||||
\margl1440\margr1440\vieww13380\viewh14580\viewkind0
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs24 \cf0 This package will install Python $FULL_VERSION for macOS $MACOSX_DEPLOYMENT_TARGET for the following architecture(s): $ARCHITECTURES.\
|
||||
|
@ -56,7 +56,15 @@ Due to new security checks on macOS 10.15 Catalina, when launching IDLE macOS ma
|
|||
\f0\b0 button to proceed.\
|
||||
\
|
||||
|
||||
\f1\b \ul Other changes\
|
||||
\f1\b \ul macOS 11.0 (Big Sur) and Apple Silicon Mac support [new in 3.10.0a3]\
|
||||
|
||||
\f0\b0 \ulnone \
|
||||
As of 2020-11, macOS 11.0 (Big Sur) is the latest release of macOS and one of its major features is the support of new Apple Silicon Macs that are based on the ARM64 CPU architecture specification rather than the Intel 64 (x86_64) architecture used previously. There are other changes in Big Sur that affect Python operation regardless of CPU architecture.\
|
||||
\
|
||||
Beginning with 3.10.0a3, we provide a new "universal2" installer variant that provides universal binaries for both ARM64 and Intel 64 architectures and is also supported on all Macs that support macOS 10.9 or later. Some of the advantages of the new installer variant: native ARM64 code on Apple Silicon Macs should run significantly faster than Rosetta2-emulated code; some operating system functions and options introduced in macOS releases since 10.9 are now exposed when available (primarily in the os module); the new installer variant includes Tcl/Tk 8.6.10 rather than 8.6.8.\
|
||||
|
||||
\f1\b \ul \
|
||||
Other changes\
|
||||
|
||||
\f0\b0 \ulnone \
|
||||
For other changes in this release, see the
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Keep IDLE running on macOS. Remove obsolete workaround that prevented
|
||||
running files with shortcuts when using new universal2 installers built
|
||||
on macOS 11.
|
Loading…
Reference in New Issue