Emit a deprecation warning if the numeric literal is immediately followed by
one of keywords: and, else, for, if, in, is, or. Raise a syntax error with
more informative message if it is immediately followed by other keyword or
identifier.
Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 2ea6d89028)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
These are the settings that extend the help menu. Moving them shortens the dialog and will help with it being too tall for small screens.
(cherry picked from commit ab36b9f834)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 257e400a19)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
1. SyntaxError args have a tuple of other attributes.
2. Attributes are adjusted for errors in f-string field expressions.
3. Compile() can raise SyntaxErrors.
(cherry picked from commit 67dfa6f2a5)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
test_disallow_instantiation and test_readonly_types try to test all the available
digests, however under FIPS mode, while the algorithms are available, trying to use
them will fail with a ValueError.
(cherry picked from commit a46c220edc)
Co-authored-by: stratakis <cstratak@redhat.com>
Co-authored-by: stratakis <cstratak@redhat.com>
Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis.
(cherry picked from commit 39dd141)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
When compiling an AST object with a direct / indirect reference
cycles, on the conversion phase because of exceeding amount of
calls, a segfault was raised. This patch adds recursion guards to
places for preventing user inputs to not to crash AST but instead
raise a RecursionError.
(cherry picked from commit f3491242e4)
Co-authored-by: Batuhan Taskaya <batuhan@python.org>
Fix test_ssl.test_wrong_cert_tls13(): use suppress_ragged_eofs=False,
since read() can raise ssl.SSLEOFError on Windows.
(cherry picked from commit ea0210fa8c)
Co-authored-by: Victor Stinner <vstinner@python.org>
Allocate and track statement objects in pysqlite_statement_create.
By allocating and tracking creation of statement object in
pysqlite_statement_create(), the caller does not need to worry about GC
syncronization, and eliminates the possibility of getting a badly
created object. All related fault handling is moved to
pysqlite_statement_create().
Co-authored-by: Victor Stinner <vstinner@python.org>.
(cherry picked from commit fffa0f92ad)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
BPO-42914 was not added to the What's New in GH-24864. This includes it in the "Improved Modules" section.
Automerge-Triggered-By: GH:gpshead
(cherry picked from commit 4846ea95d1)
Co-authored-by: Wm. Keith van der Meulen <keith@wkeithvan.com>
It wasn't actually detecting the regression due to the
assertion being too lenient.
(cherry picked from commit e60ab843cb)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Signed-off-by: Tal Einat <532281+taleinat@users.noreply.github.com>
(cherry picked from commit adef445dc3)
Co-authored-by: Tal Einat <532281+taleinat@users.noreply.github.com>
This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well.
(cherry picked from commit bdb56902a3)
Co-authored-by: stratakis <cstratak@redhat.com>
Fix test_pha_required_nocert() of test_ssl: catch two more EOF cases
(when the recv() method returns an empty string).
(cherry picked from commit 320eaa7f42)
Co-authored-by: Victor Stinner <vstinner@python.org>
* _testcapi.heapgctype: implement a traverse function since the type
is defined with Py_TPFLAGS_HAVE_GC.
* _decimal: PyDecSignalDictMixin_Type is no longer defined with
Py_TPFLAGS_HAVE_GC since it has no traverse function.
(cherry picked from commit 142e5c5445)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
On macOS, tk defers to system setting for button background when in normal state.
Give turtledemo button text a color that works on either light or dark background.
(cherry picked from commit af5a324843)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>