Imported Upstream version 3.9.9 upstream/3.9.9
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 25 Jan 2022 23:27:54 +0000 (08:27 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 25 Jan 2022 23:27:54 +0000 (08:27 +0900)
31 files changed:
Doc/glossary.rst
Doc/library/contextvars.rst
Doc/library/copy.rst
Doc/library/socket.rst
Doc/whatsnew/3.9.rst
Include/patchlevel.h
Lib/argparse.py
Lib/copy.py
Lib/importlib/metadata.py
Lib/json/tool.py
Lib/pydoc_data/topics.py
Lib/test/test_argparse.py
Lib/test/test_json/test_tool.py
Lib/test/test_syntax.py
Lib/tkinter/test/test_ttk/test_extensions.py
Misc/NEWS
Modules/_ctypes/libffi_osx/README
Objects/typeobject.c
PC/getpathp.c
PC/pylauncher.rc
PC/pyshellext.rc
PC/python_exe.rc
PC/python_nt.rc
PC/pythonw_exe.rc
PC/sqlite3.rc
PCbuild/get_externals.bat
PCbuild/pythoncore.vcxproj
PCbuild/tcltk.props
Parser/pegen/pegen.c
Parser/tokenizer.c
README.rst

index 96d33ac1abb83fb1c5707347ec81a44053b8b950..da9dc9ceebfc4b55073e404f81a7936d6387bff0 100644 (file)
@@ -485,12 +485,13 @@ Glossary
       :func:`functools.singledispatch` decorator, and :pep:`443`.
 
    generic type
-      A :term:`type` that can be parameterized; typically a container like
-      :class:`list`. Used for :term:`type hints <type hint>` and
+      A :term:`type` that can be parameterized; typically a
+      :ref:`container class<sequence-types>` such as :class:`list` or
+      :class:`dict`. Used for :term:`type hints <type hint>` and
       :term:`annotations <annotation>`.
 
-      See :pep:`483` for more details, and :mod:`typing` or
-      :ref:`generic alias type <types-genericalias>` for its uses.
+      For more details, see :ref:`generic alias types<types-genericalias>`,
+      :pep:`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module.
 
    GIL
       See :term:`global interpreter lock`.
index 14ac47f4c9eb164050749ff5b7431b720c11145d..be1dd0c9eb57e8a8a4a9f4a60e8aebdf42d7baf9 100644 (file)
@@ -94,7 +94,7 @@ Context Variables
           # var.get() would raise a LookupError.
 
 
-.. class:: contextvars.Token
+.. class:: Token
 
    *Token* objects are returned by the :meth:`ContextVar.set` method.
    They can be passed to the :meth:`ContextVar.reset` method to revert
index 0eb5a793ad953a23eafac57e2a6eb9d35899b016..ce50c331bec86515156153e384d17f6bd5a3c9d5 100644 (file)
@@ -60,7 +60,7 @@ The :func:`deepcopy` function avoids these problems by:
   components copied.
 
 This module does not copy types like module, method, stack trace, stack frame,
-file, socket, window, array, or any similar types.  It does "copy" functions and
+file, socket, window, or any similar types.  It does "copy" functions and
 classes (shallow and deeply), by returning the original object unchanged; this
 is compatible with the way these are treated by the :mod:`pickle` module.
 
index db94a2a1245755f5c6632d7bfcfebc75b2b1f996..f0a1338e2b85e616e50e72d0f96ba585dcfe6430 100755 (executable)
@@ -552,7 +552,7 @@ Creating sockets
 The following functions all create :ref:`socket objects <socket-objects>`.
 
 
-.. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
+.. class:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
 
    Create a new socket using the given address family, socket type and protocol
    number.  The address family should be :const:`AF_INET` (the default),
index c29715d192f9534207b52812a4a5bc49079d0fbc..0662adba7d4af5fe63c5a4bef70eb27c82a19c37 100644 (file)
@@ -1377,10 +1377,6 @@ Porting to Python 3.9
     becomes an alias to the :c:func:`PyObject_NewVar` macro. They no longer
     access directly the :c:member:`PyTypeObject.tp_basicsize` member.
 
-  * :c:func:`PyType_HasFeature` now always calls :c:func:`PyType_GetFlags`.
-    Previously, it accessed directly the :c:member:`PyTypeObject.tp_flags`
-    member when the limited C API was not used.
-
   * :c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro was converted to a function:
     the macro accessed directly the :c:member:`PyTypeObject.tp_weaklistoffset`
     member.
index 8057ab920cb45cf20fbf1318c3224ee6791a2271..293e51a25d0f85eab096aa459cb62bb23f10a24b 100644 (file)
 /*--start constants--*/
 #define PY_MAJOR_VERSION        3
 #define PY_MINOR_VERSION        9
-#define PY_MICRO_VERSION        8
+#define PY_MICRO_VERSION        9
 #define PY_RELEASE_LEVEL        PY_RELEASE_LEVEL_FINAL
 #define PY_RELEASE_SERIAL       0
 
 /* Version as a string */
-#define PY_VERSION              "3.9.8"
+#define PY_VERSION              "3.9.9"
 /*--end constants--*/
 
 /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
index cb5345d555afeedb35e59f3da398d4e97923d1f2..7c28547f3e522c68b9f9a24058c36b2ef6f8ee85 100644 (file)
@@ -1209,8 +1209,7 @@ class _SubParsersAction(Action):
         # namespace for the relevant parts.
         subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
         for key, value in vars(subnamespace).items():
-            if not hasattr(namespace, key):
-                setattr(namespace, key, value)
+            setattr(namespace, key, value)
 
         if arg_strings:
             vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, [])
@@ -1844,6 +1843,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
                     if action.default is not SUPPRESS:
                         setattr(namespace, action.dest, action.default)
 
+        # add any parser defaults that aren't present
+        for dest in self._defaults:
+            if not hasattr(namespace, dest):
+                setattr(namespace, dest, self._defaults[dest])
+
         # parse the arguments and exit if there are any errors
         if self.exit_on_error:
             try:
@@ -1854,11 +1858,6 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
         else:
             namespace, args = self._parse_known_args(args, namespace)
 
-        # add any parser defaults that aren't present
-        for dest in self._defaults:
-            if not hasattr(namespace, dest):
-                setattr(namespace, dest, self._defaults[dest])
-
         if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR):
             args.extend(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR))
             delattr(namespace, _UNRECOGNIZED_ARGS_ATTR)
index 41873f2c046cac9ea3db6a284c57b2b53d7e6fa3..1081d43952e1ecd00cb627dca2fa6cbb039cf422 100644 (file)
@@ -39,8 +39,8 @@ Python's deep copy operation avoids these problems by:
     set of components copied
 
 This version does not copy types like module, class, function, method,
-nor stack trace, stack frame, nor file, socket, window, nor array, nor
-any similar types.
+nor stack trace, stack frame, nor file, socket, window, nor any
+similar types.
 
 Classes can use the same interfaces to control copying that they use
 to control pickling: they can define methods called __getinitargs__(),
index ffa0cba45706d6e77ffea484fc05ce2cfb405e67..c6c7d31aa5d8ae0bccfd571ac7a5e259d6d3b86e 100644 (file)
@@ -419,7 +419,7 @@ class FastPath:
 
     def children(self):
         with suppress(Exception):
-            return os.listdir(self.root or '')
+            return os.listdir(self.root or '.')
         with suppress(Exception):
             return self.zip_children()
         return []
index 5dee0a744b2a99e1e88c52dfecfec56a8598d10f..0490b8c0be11dfec924f5dc075e42961d364bf91 100644 (file)
@@ -13,6 +13,7 @@ Usage::
 import argparse
 import json
 import sys
+from pathlib import Path
 
 
 def main():
@@ -25,9 +26,9 @@ def main():
                         help='a JSON file to be validated or pretty-printed',
                         default=sys.stdin)
     parser.add_argument('outfile', nargs='?',
-                        type=argparse.FileType('w', encoding="utf-8"),
+                        type=Path,
                         help='write the output of infile to outfile',
-                        default=sys.stdout)
+                        default=None)
     parser.add_argument('--sort-keys', action='store_true', default=False,
                         help='sort the output of dictionaries alphabetically by key')
     parser.add_argument('--no-ensure-ascii', dest='ensure_ascii', action='store_false',
@@ -58,15 +59,21 @@ def main():
         dump_args['indent'] = None
         dump_args['separators'] = ',', ':'
 
-    with options.infile as infile, options.outfile as outfile:
+    with options.infile as infile:
         try:
             if options.json_lines:
                 objs = (json.loads(line) for line in infile)
             else:
-                objs = (json.load(infile), )
-            for obj in objs:
-                json.dump(obj, outfile, **dump_args)
-                outfile.write('\n')
+                objs = (json.load(infile),)
+
+            if options.outfile is None:
+                out = sys.stdout
+            else:
+                out = options.outfile.open('w', encoding='utf-8')
+            with out as outfile:
+                for obj in objs:
+                    json.dump(obj, outfile, **dump_args)
+                    outfile.write('\n')
         except ValueError as e:
             raise SystemExit(e)
 
index 8567e304a09edfb75674d7458617097625e2b4aa..890a61668df1c022d20de7913472ab3f3347f260 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Fri Nov  5 20:19:23 2021
+# Autogenerated by Sphinx on Mon Nov 15 18:21:10 2021
 topics = {'assert': 'The "assert" statement\n'
            '**********************\n'
            '\n'
index c3c3a75fafff7e19deaed807fb8799de861ac6ef..d79ac5a4651d97c3553d4a28c2206950e6a05ea4 100644 (file)
@@ -3095,12 +3095,6 @@ class TestSetDefaults(TestCase):
         xparser.set_defaults(foo=2)
         self.assertEqual(NS(foo=2), parser.parse_args(['X']))
 
-    def test_set_defaults_on_subparser_with_namespace(self):
-        parser = argparse.ArgumentParser()
-        xparser = parser.add_subparsers().add_parser('X')
-        xparser.set_defaults(foo=1)
-        self.assertEqual(NS(foo=2), parser.parse_args(['X'], NS(foo=2)))
-
     def test_set_defaults_same_as_add_argument(self):
         parser = ErrorRaisingArgumentParser()
         parser.set_defaults(w='W', x='X', y='Y', z='Z')
index fc2a7a4fca3c5a3f4769ed86e961a364f43b6368..d441bb15a7e8fb338bd74c23170e6c6df2ef1327 100644 (file)
@@ -130,6 +130,15 @@ class TestTool(unittest.TestCase):
         self.assertEqual(out, b'')
         self.assertEqual(err, b'')
 
+    def test_writing_in_place(self):
+        infile = self._create_infile()
+        rc, out, err = assert_python_ok('-m', 'json.tool', infile, infile)
+        with open(infile, "r", encoding="utf-8") as fp:
+            self.assertEqual(fp.read(), self.expect)
+        self.assertEqual(rc, 0)
+        self.assertEqual(out, b'')
+        self.assertEqual(err, b'')
+
     def test_jsonlines(self):
         args = sys.executable, '-m', 'json.tool', '--json-lines'
         process = subprocess.run(args, input=self.jsonlines_raw, capture_output=True, text=True, check=True)
index eaa94ea92b5cd2d16f47daaf8f03d924d372e011..46f27d04443649ec1310934c769cec7b42090a44 100644 (file)
@@ -953,7 +953,13 @@ def func2():
     def test_invalid_line_continuation_error_position(self):
         self._check_error(r"a = 3 \ 4",
                           "unexpected character after line continuation character",
-                          lineno=1, offset=(10 if support.use_old_parser() else 9))
+                          lineno=1, offset=8)
+        self._check_error('1,\\#\n2',
+                          "unexpected character after line continuation character",
+                          lineno=1, offset=4)
+        self._check_error('\nfgdfgf\n1,\\#\n2\n',
+                          "unexpected character after line continuation character",
+                          lineno=3, offset=4)
 
     def test_invalid_line_continuation_left_recursive(self):
         # Check bpo-42218: SyntaxErrors following left-recursive rules
index 7fc1ebb95c970ea78a13b87e6bb51e090f2657c9..1220c4831c52f4a34cb1052476bf15dd95820334 100644 (file)
@@ -307,14 +307,14 @@ class OptionMenuTest(AbstractTkTest, unittest.TestCase):
         items = ('a', 'b', 'c')
         textvar = tkinter.StringVar(self.root)
         def cb_test(*args):
-            self.assertEqual(textvar.get(), items[1])
-            success.append(True)
+            success.append(textvar.get())
         optmenu = ttk.OptionMenu(self.root, textvar, "a", *items)
         optmenu.pack()
-        cb_name = textvar.trace("w", cb_test)
+        cb_name = textvar.trace_add("write", cb_test)
         optmenu['menu'].invoke(1)
-        self.assertEqual(success, [True])
-        textvar.trace_vdelete("w", cb_name)
+        self.assertEqual(success, ['b'])
+        self.assertEqual(textvar.get(), 'b')
+        textvar.trace_remove("write", cb_name)
         optmenu.destroy()
 
 
index 7e68c919ba1c32ea9155e914b35e61256efe93ba..9cebf20867b45f303b43fdbb2d8ef3df96fc6a9a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2,6 +2,50 @@
 Python News
 +++++++++++
 
+What's New in Python 3.9.9 final?
+=================================
+
+*Release date: 2021-11-15*
+
+Core and Builtins
+-----------------
+
+- bpo-45738: Fix computation of error location for invalid continuation
+  characters in the parser. Patch by Pablo Galindo.
+
+Library
+-------
+
+- bpo-45235: Reverted an argparse bugfix that caused regression in the
+  handling of default arguments for subparsers.  This prevented leaf level
+  arguments from taking precedence over root level arguments.
+
+- bpo-45765: In importlib.metadata, fix distribution discovery for an empty
+  path.
+
+- bpo-45644: In-place JSON file formatting using ``python3 -m json.tool
+  infile infile`` now works correctly, previously it left the file empty.
+  Patch by Chris Wesseling.
+
+Documentation
+-------------
+
+- bpo-45772: ``socket.socket`` documentation is corrected to a class from a
+  function.
+
+- bpo-45392: Update the docstring of the :class:`type` built-in to remove a
+  redundant line and to mention keyword arguments for the constructor.
+
+Windows
+-------
+
+- bpo-45732: Updates bundled Tcl/Tk to 8.6.12.
+
+- bpo-45720: Internal reference to :file:`shlwapi.dll` was dropped to help
+  improve startup time. This DLL will no longer be loaded at the start of
+  every Python process.
+
+
 What's New in Python 3.9.8 final?
 =================================
 
index 69e46cbf8a420fa5e63796cad97a938e01ab8a73..54f00e3ec1ff3821e4a793770d5d72947fae9d17 100644 (file)
@@ -165,7 +165,7 @@ for checking. It will be one of the following:
 Before making the call, the VALUES vector should be initialized 
 with pointers to the appropriate argument values.
 
-To call the the function using the initialized ffi_cif, use the
+To call the function using the initialized ffi_cif, use the
 ffi_call function:
 
 void ffi_call(ffi_cif *cif, void *fn, void *rvalue, void **avalues);
index feae25f2eb367a8c3b7bf6a9e67137e89d099cf9..1cdf80bfcf5affe176967d82d2cf8c7d219879ae 100644 (file)
@@ -3673,10 +3673,8 @@ static PyMethodDef type_methods[] = {
 };
 
 PyDoc_STRVAR(type_doc,
-/* this text signature cannot be accurate yet.  will fix.  --larry */
-"type(object_or_name, bases, dict)\n"
 "type(object) -> the object's type\n"
-"type(name, bases, dict) -> a new type");
+"type(name, bases, dict, **kwds) -> a new type");
 
 static int
 type_traverse(PyTypeObject *type, visitproc visit, void *arg)
index dc5b201d145f33dbdb1229129bffb52ed01dfdab..7c0eeab5dbab4a36ee5957ac764c6dc026a45158 100644 (file)
@@ -91,7 +91,6 @@
 
 #include <windows.h>
 #include <pathcch.h>
-#include <shlwapi.h>
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
index d21f9b6e9d2aba9902b1496fdeb3ae19fc364daa..ff7e71e0fdb4e1d52e3892dff1dfc802e85eedc0 100644 (file)
@@ -2,6 +2,11 @@
 
 #include "python_ver_rc.h"
 
+#ifndef RT_MANIFEST
+// bpo-45220: Cannot reliably #include RT_MANIFEST from
+// anywhere, so we hardcode it
+#define RT_MANIFEST 24
+#endif
 // Include the manifest file that indicates we support all
 // current versions of Windows.
 1 RT_MANIFEST "python.manifest"
index fc607e97840fb0d62e8d7964cfe3d39448f82099..af797ce95d5077e36a79f09dc6f1510ebdec6ab7 100644 (file)
@@ -2,6 +2,12 @@
 
 #include "python_ver_rc.h"
 
+#ifndef RT_MANIFEST
+// bpo-45220: Cannot reliably #include RT_MANIFEST from
+// anywhere, so we hardcode it
+#define RT_MANIFEST 24
+#endif
+
 // Include the manifest file that indicates we support all
 // current versions of Windows.
 1 RT_MANIFEST "python.manifest"
index 5eba89962b475b04903a29255058e26baccb71cb..c3d3bff019895e90ef64b289342720b63799f2e6 100644 (file)
@@ -2,6 +2,12 @@
 
 #include "python_ver_rc.h"
 
+#ifndef RT_MANIFEST
+// bpo-45220: Cannot reliably #include RT_MANIFEST from
+// anywhere, so we hardcode it
+#define RT_MANIFEST 24
+#endif
+
 // Include the manifest file that indicates we support all
 // current versions of Windows.
 1 RT_MANIFEST "python.manifest"
index 6fd872c1a03cc27d6d4926b9547f62f8144046e2..ae64fbd217af740254c79528f4a55ecab79c9b2e 100644 (file)
@@ -2,6 +2,12 @@
 
 #include "python_ver_rc.h"
 
+#ifndef RT_MANIFEST
+// bpo-45220: Cannot reliably #include RT_MANIFEST from
+// anywhere, so we hardcode it
+#define RT_MANIFEST 24
+#endif
+
 // Include the manifest file that indicates we support all
 // current versions of Windows.
 2 RT_MANIFEST "python.manifest"
index 562652be184719a4b0a6a9629066ef12154253d5..38570b74fa3e0204cbee99df4e702556d4f5dde0 100644 (file)
@@ -2,6 +2,12 @@
 
 #include "python_ver_rc.h"
 
+#ifndef RT_MANIFEST
+// bpo-45220: Cannot reliably #include RT_MANIFEST from
+// anywhere, so we hardcode it
+#define RT_MANIFEST 24
+#endif
+
 // Include the manifest file that indicates we support all
 // current versions of Windows.
 1 RT_MANIFEST "python.manifest"
index d2c18f8add8b26e239580c6c38f4597bc763b7e6..9ae2aa0f6f2f2cc1a0d3331d979fd8feb6c51d52 100644 (file)
@@ -2,6 +2,12 @@
 
 #include <winver.h>
 
+#ifndef RT_MANIFEST
+// bpo-45220: Cannot reliably #include RT_MANIFEST from
+// anywhere, so we hardcode it
+#define RT_MANIFEST 24
+#endif
+
 // Include the manifest file that indicates we support all
 // current versions of Windows.
 2 RT_MANIFEST "python.manifest"
index c3a7748027a2b61be5ff59e11773fd1097baa15e..9dd08669588a7e27d1d374b7ef2bbddf35bd3283 100644 (file)
@@ -55,8 +55,8 @@ set libraries=%libraries%                                       bzip2-1.0.6
 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries%  libffi-3.3.0\r
 if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries%     openssl-1.1.1l\r
 set libraries=%libraries%                                       sqlite-3.35.5.0\r
-if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0\r
-if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0\r
+if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.12.0\r
+if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.12.0\r
 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tix-8.4.3.6\r
 set libraries=%libraries%                                       xz-5.2.2\r
 set libraries=%libraries%                                       zlib-1.2.11\r
@@ -78,7 +78,7 @@ echo.Fetching external binaries...
 set binaries=\r
 if NOT "%IncludeLibffi%"=="false"  set binaries=%binaries% libffi-3.3.0\r
 if NOT "%IncludeSSL%"=="false"     set binaries=%binaries% openssl-bin-1.1.1l\r
-if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0\r
+if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.12.0\r
 if NOT "%IncludeSSLSrc%"=="false"  set binaries=%binaries% nasm-2.11.06\r
 \r
 for %%b in (%binaries%) do (\r
index c942e9e01ca9a02d3bc7838c75da55fb0f775929..1df62ca35164c853388887768d5789616031395e 100644 (file)
       <PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
     </ClCompile>\r
     <Link>\r
-      <AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;pathcch.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <AdditionalDependencies>version.lib;ws2_32.lib;pathcch.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
     </Link>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index d2f94967d0eae5367ed5e3037d3de57a745ab54a..e804cc5e2c3a37f9a2e3905e3a83cb05614f9415 100644 (file)
@@ -4,7 +4,7 @@
   <PropertyGroup>\r
     <TclMajorVersion>8</TclMajorVersion>\r
     <TclMinorVersion>6</TclMinorVersion>\r
-    <TclPatchLevel>9</TclPatchLevel>\r
+    <TclPatchLevel>12</TclPatchLevel>\r
     <TclRevision>0</TclRevision>\r
     <TkMajorVersion>$(TclMajorVersion)</TkMajorVersion>\r
     <TkMinorVersion>$(TclMinorVersion)</TkMinorVersion>\r
index 98de05c5cdb696f5b97307f790192800dc8ccba8..efcf9ac1ebd742470feddd70c0627bbf04ca082e 100644 (file)
@@ -348,14 +348,7 @@ tokenizer_error(Parser *p)
             msg = "too many levels of indentation";
             break;
         case E_LINECONT: {
-            char* loc = strrchr(p->tok->buf, '\n');
-            const char* last_char = p->tok->cur - 1;
-            if (loc != NULL && loc != last_char) {
-                col_offset = p->tok->cur - loc - 1;
-                p->tok->buf = loc;
-            } else {
-                col_offset = last_char - p->tok->buf - 1;
-            }
+            col_offset = p->tok->cur - p->tok->buf - 1;
             msg = "unexpected character after line continuation character";
             break;
         }
@@ -363,7 +356,8 @@ tokenizer_error(Parser *p)
             msg = "unknown parsing error";
     }
 
-    RAISE_ERROR_KNOWN_LOCATION(p, errtype, p->tok->lineno, col_offset, msg);
+    RAISE_ERROR_KNOWN_LOCATION(p, errtype, p->tok->lineno,
+                               col_offset >= 0 ? col_offset : 0, msg);
     return -1;
 }
 
index 1a57db97c4ecd5d22498ae0a632e8a1b405c6f32..41bfdb853c7a68982c064a4cd68f971c39ae6ceb 100644 (file)
@@ -1752,7 +1752,6 @@ tok_get(struct tok_state *tok, const char **p_start, const char **p_end)
         c = tok_nextc(tok);
         if (c != '\n') {
             tok->done = E_LINECONT;
-            tok->cur = tok->inp;
             return ERRORTOKEN;
         }
         c = tok_nextc(tok);
index ef78796301dc09bace1429da4ce702742808c8f9..b808463b71271d85a22ef9e45c6eafda45d9b7d6 100644 (file)
@@ -1,4 +1,4 @@
-This is Python version 3.9.8
+This is Python version 3.9.9
 ============================
 
 .. image:: https://travis-ci.org/python/cpython.svg?branch=3.9