| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`ast.parse` and `compile` support a `feature_version` parameter that
tells the parser to parse the input string, as if it were written in
an older Python version.
The `feature_version` is propagated to the tokenizer, which uses it
to handle the three different stages of support for `async` and
`await`. Additionally, it disallows the following at parser level:
- The '@' operator in < 3.5
- Async functions in < 3.5
- Async comprehensions in < 3.6
- Underscores in numeric literals in < 3.6
- Await expression in < 3.5
- Variable annotations in < 3.6
- Async for-loops in < 3.5
- Async with-statements in < 3.5
- F-strings in < 3.6
Closes we-like-parsers/cpython#124.
|
| |
|
|
|
|
|
| |
Replace TestFailed with support.TestFailed.
Bug spotted by pyflakes.
|
| |
|
|
|
| |
Cast Py_ARRAY_LENGTH() size_t to int explicitly.
|
|
|
|
|
| |
(GH-19811)" (#19821)
This reverts commit 2514a632fb7d37be24c2059d0e286d35600f9795.
|
|
|
|
|
| |
Before this commit, if an exception was active inside a generator
when calling gen.throw(), then that exception was lost (i.e. there
was no implicit exception chaining). This commit fixes that.
|
|
|
|
|
|
|
|
|
|
| |
This implements full support for # type: <type> comments, # type: ignore <stuff> comments, and the func_type parsing mode for ast.parse() and compile().
Closes https://github.com/we-like-parsers/cpython/issues/95.
(For now, you need to use the master branch of mypy, since another issue unique to 3.9 had to be fixed there, and there's no mypy release yet.)
The only thing missing is `feature_version=N`, which is being tracked in https://github.com/we-like-parsers/cpython/issues/124.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* bpo-40394 - difflib.SequenceMatched.find_longest_match default args
Added default args to find_longest_match, as well as related tests.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Now that the default parser is the new PEG parser, ast.parse uses it, which means that we don't actually test something in test_peg_parser. This commit introduces a new keyword argument (`oldparser`) for `_peg_parser.parse_string` for specifying that a string needs to be parsed with the old parser. This keyword argument is used in the tests to actually compare the ASTs the new parser generates with those generated by the old parser.
|
|
|
|
| |
Add support for CAN_J1939 sockets that wrap SAE J1939 protocol
functionality provided by Linux 5.4+ kernels.
|
|
|
| |
Co-authored-by: Alex Povel <python@alexpovel.de>
|
| |
|
| |
|
|
|
|
|
| |
Remove _random.Random.randbytes(): the C implementation of
randbytes(). Implement the method in Python to ease subclassing:
randbytes() now directly reuses getrandbits().
|
|
|
|
|
|
| |
test.pythoninfo logs OpenSSL FIPS_mode() and Linux
/proc/sys/crypto/fips_enabled in a new "fips" section.
Co-Authored-By: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Move Build Changes and C API Changes to the end of the document.
Most Python users don't build Python themselves and don't use the C
API. Other changes:
* Add Build Changes section
* Add sub-sections to the C API Changes
* Sort modules in Improved Modules section: move nntplib after
multiprocessing
|
|
|
| |
More robust frame.setlineno. Makes no assumptions about source->bytecode translation.
|
|
|
| |
test_gdb and test.pythoninfo now check gdb command exit code.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Update the source path of the pegen target within the Windows regen project.
Change the path to Windows path formats.
* Use the more reliable SetEnv task for Cpp Projects in MSBuild.
|
| |
|
|
|
|
| |
They were removed from the C API in commit
ae00a5a88534fd45939f86c12e038da9fa6f9ed6.
|
|
|
|
|
| |
After parsing is done in single statement mode, the tokenizer buffer has to be checked for additional lines and a `SyntaxError` must be raised, in case there are any.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
| |
Fix a race condition in concurrent.futures._ThreadWakeup: access to
_ThreadWakeup is now protected with the shutdown lock.
|
|
|
|
|
|
| |
New PyFrame_GetBack() function: get the frame next outer frame.
Replace frame->f_back with PyFrame_GetBack(frame) in most code but
frameobject.c, ceval.c and genobject.c.
|
|
|
| |
Add a new test.support.hashlib_helper submodule.
|
|
|
|
| |
(GH-19779)
|
|
|
|
| |
The PyThreadState_GetFrame() function now returns a strong reference
to the frame.
|
|
|
| |
`JoinedStr`s and `FormattedValue also needs to be shifted, in order to correctly compute the location information of nested f-strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the following function from the C API:
* PyAsyncGen_ClearFreeLists()
* PyContext_ClearFreeList()
* PyDict_ClearFreeList()
* PyFloat_ClearFreeList()
* PyFrame_ClearFreeList()
* PyList_ClearFreeList()
* PySet_ClearFreeList()
* PyTuple_ClearFreeList()
Make these functions private, move them to the internal C API and
change their return type to void.
Call explicitly PyGC_Collect() to free all free lists.
Note: PySet_ClearFreeList() did nothing.
|
|
|
|
| |
Add super_init_without_args() sub-function. Hold a strong reference
to the frame code object while calling super_init_without_args().
|
|
|
|
|
| |
This PR adds the functionality requested by https://github.com/ericsnowcurrently/multi-core-python/issues/52.
Automerge-Triggered-By: @ericsnowcurrently
|
|
|
|
|
|
| |
*** File "/usr/lib64/python3.9/turtledemo/__main__.py", line 275
bg="#d00" if clear == NORMAL else"#fca")
^
SyntaxError: invalid string prefix
|
| |
|
|
|
|
|
| |
This allows the caller to avoid creation of an exception when the channel is empty (just like `dict.get()` works). `ChannelEmptyError` is still raised if no default is provided.
Automerge-Triggered-By: @ericsnowcurrently
|
|
|
| |
Add frame_nslots() to factorize duplicate code.
|
|
|
|
|
|
|
| |
methods in MagicMock" (GH-19734)
* Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock (#16029)"
This reverts commit 72b1004657e60c900e4cd031b2635b587f4b280e.
|
|
|
| |
require `_generate_next_value_` to be defined before members
|
|
|
|
|
|
|
|
|
| |
PyFrame_GetCode(frame): return a borrowed reference to the frame
code.
Replace frame->f_code with PyFrame_GetCode(frame) in most code,
except in frameobject.c, genobject.c and ceval.c.
Also add PyFrame_GetLineNumber() to the limited C API.
|