| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
(GH-27160) (GH-27163)
(cherry picked from commit f333ab0f2edec26a769ed558263ac662e5475451)
|
|
|
|
|
| |
* Make sure that line number is set when entering comprehension scope in compiler.
(cherry picked from commit 82e5c28af7049c4f5343c808f172cbe2e145f49b)
|
|
|
|
|
|
|
|
|
|
|
| |
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 2ea6d890281c415e0a2f00e63526e592da8ce3d9)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Modify compiler to reduce stack consumption for large expressions.
* Add more tests for stack usage.
* Add NEWS item.
* Raise SystemError for truly excessive stack use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* test_asyncio
* test_bz2
* test_math
* test_cmath
* test_cmd_line
* test_cmd_line_script
* test_compile
* test_contextlib
* test_profile
* ctypes/test/test_find
* test_multiprocessing
* test_configparser
* test_csv
* test_dbm_dumb
* test_decimal
* test_difflib
* os.fdopen() calls io.text_encoding() to emit EncodingWarning for right place.
|
|
|
|
| |
626. (GH-24860)
|
|
|
|
| |
calls, conform to PEP 626. (GH-24859)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-23733)
* Delete jump instructions that bypass empty blocks
* Add news entry
* Explicitly check for unconditional jump opcodes
Using the is_jump function results in the inclusion of instructions like
returns for which this optimization is not really valid. So, instead
explicitly check that the instruction is an unconditional jump.
* Handle conditional jumps, delete jumps gracefully
* Ensure b_nofallthrough and b_reachable are valid
* Add test for redundant jumps
* Regenerate importlib.h and edit Misc/ACKS
* Fix bad whitespace
|
|
|
|
| |
statements conform to PEP 626. (GH-23743)
|
|
|
|
|
| |
line number (GH-23636)
Don't forget the entry block when ensuring that all exits have a line number.
|
|
|
|
|
| |
by PEP 626 (GH-23495)
Make sure that line number is correct after a return, as defined by PEP 626.
|
|
|
| |
Make sure that CFG from compiler front-end is correct. Be a bit more aggressive in the compiler back-end.
|
|
|
| |
* Implement new line number table format, as defined in PEP 626.
|
|
|
|
| |
(GH-21850)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use new test.support helper submodules in tests:
* distutils tests
* test_buffer
* test_compile
* test_filecmp
* test_fileinput
* test_readline
* test_smtpnet
* test_structmembers
* test_tools
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
* Rename PyConfig.use_peg to _use_peg_parser
* Document PyConfig._use_peg_parser and mark it a deprecated
* Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated
in the documentation.
* Add use_old_parser() and skip_if_new_parser() to test.support
* Remove sys.flags.use_peg: use_old_parser() uses
_testinternalcapi.get_configs() instead.
* Enhance test_embed tests
* subprocess._args_from_interpreter_flags() copies -X oldparser
|
|
|
|
| |
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
syntax errors (GH-14612)
https://bugs.python.org/issue37500
Add a new field to the compiler structure that allows to be configured
so no bytecode is emitted. In this way is possible to detect errors by
walking the nodes while preserving optimizations.
https://bugs.python.org/issue37500
|
|
|
| |
This reverts commit 1005c84535191a72ebb7587d8c5636a065b7ed79.
|
|
|
|
|
| |
Partically revert commit c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 to
fix a reference leak.
|
|
|
|
|
|
|
| |
There are some same consts in a module. This commit merges them into
single instance. It reduces number of objects in memory after loading modules.
https://bugs.python.org/issue34100
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.
Do a bounds check within find_op so it can return before going past the end as a safety measure.
https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447#diff-a33329ae6ae0bb295d742f0caf93c137
introduced this off by one error while fixing another one nearby.
This bug was shipped in all Python 3.6 and 3.7 releases.
The included unittest won't fail unless you do a clang msan build.
|
|
|
|
|
|
|
|
|
|
| |
(GH-10284)
Two kind of mistakes:
1. Missed space. After concatenating there is no space between words.
2. Missed comma. Causes unintentional concatenating in a list of strings.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
This fixes also bpo-22091.
|
|\
| |
| |
| | |
Warnings could be emitted at compile time.
|
| |\
| | |
| | |
| | | |
Warnings could be emitted at compile time.
|
| | |
| | |
| | |
| | | |
Warnings could be emitted at compile time.
|
|/ /
| |
| |
| | |
collections.namedtuple() now supports tuples with more than 255 elements.
|
| | |
|
|/
|
|
| |
as path in compile() and similar functions is now deprecated.
|
|
|
|
| |
an iterable of integers. Now only strings and byte-like objects are accepted.
|
|
|
|
|
|
|
|
|
| |
Issue #25843: When compiling code, don't merge constants if they are equal but
have a different types. For example, "f1, f2 = lambda: 1, lambda: 1.0" is now
correctly compiled to two different functions: f1() returns 1 (int) and f2()
returns 1.0 (int), even if 1 and 1.0 are equal.
Add a new _PyCode_ConstantKey() private function.
|
|\
| |
| |
| | |
with a null byte.
|
| |
| |
| |
| | |
with a null byte.
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This avoids possible buffer overreads when int(), float(), compile(), exec()
and eval() are passed bytes-like objects. Similar code is removed from the
complex() constructor, where it was not reachable.
Patch by John Leitch, Serhiy Storchaka and Martin Panter.
|
| | |
|
| |
| |
| |
| | |
Patch partially by Steve Dougherty.
|
| | |
|
|\ \
| |/ |
|
| | |
|